LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 03-12-2006, 01:56 AM   #1
crazibri
Member
 
Registered: Mar 2004
Location: Orange County, CA
Distribution: OS X, SuSE, RH, Debian, XP
Posts: 377

Rep: Reputation: 31
Question sudo and su issues - FC4


Hi,
I just installed FC4 for the first time. I managed to get ndiswrapper going, wpa_supplicant, and upgrade my system using "yum upgrade". Now after the upgrade, the "su" and "sudo" commands act differently and are both different than the root shell. Why?
Example:
I go to normal shell, type "su", enter root password, and type "ifconfig" and says command not found.

I try "sudo ifconfig", enter root password, password rejected

I try opening a root shell, enter password, type "ifconfig" and it displays my networking status.

Anyone know why? I checked /sbin and ifconfig is there. It must have something to do with those commands or SElinux.

Thanks!
 
Old 03-12-2006, 02:35 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
If you use "su" you need the -l option so that it starts a login shell, and runs the startup script, probably /root/.bash_profile. This sets up the path.

If you use sudo, you need to include the full path. ex: /usr/ifconfig. Sudo requires this in the setup, for example:
%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

If the /sbin/ wasn't required, a user could copy any command to their home directory, and rename it mount, and then use sudo to execute it as root.

So this is a necessary security feature.
 
Old 03-12-2006, 02:38 AM   #3
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
Quote:
Originally Posted by crazibri
I go to normal shell, type "su", enter root password, and type "ifconfig" and says command not found.
do "su -" to load root's environment variables (like the path). /sbin is not in the non-root user's path by default

Quote:
Originally Posted by crazibri
I try "sudo ifconfig", enter root password, password rejected
You don't understand how sudo works. Search for it on this site or on the Internet. Basically you add an entry for your user in /etc/sudoers, and then you enter your own password (that's the whole point of sudo).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
FC4 gdm issues digitaldrowning Linux - Software 4 02-09-2006 03:16 PM
FC4 internet issues xTheLostx Linux - Hardware 5 07-19-2005 10:24 PM
FC4 Issues spurgeonb Fedora 5 06-23-2005 05:40 AM
FC4 - NIC issues whoever Linux - Hardware 0 05-17-2005 02:52 PM


All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration