Privilege factors

Kae Verens kae at verens.com
Wed Sep 10 11:23:00 UTC 2008


Gopal Ghosh wrote:
> Dear All, could any one help me with Privilege available to *root /su/ 
> sudo and also the difference between the above three * 

"root" is a username
"su" is a command which switches who you are logged in as ("substitute user")
"sudo" allows you to run a command as if you were another user (a pun on the word "pseudo")


> ***************************************************************
> 
> [gopalghosh at localhost ~]$ whoami
> 
> gopalghosh
> 
> [gopalghosh at localhost ~]$ login
> 
> login: root
> 
> Password:
> 
> Login incorrect {why it is saying Login incorrect as I am typing the 
> correct password}

I've never seen the command "login" used in a shell before... most people use su.

check "man login" for details of login if you really want to use it. Otherwise I presume su is sufficient (I've never 
needed to use "login" myself).

> [gopalghosh at localhost ~]$ login
> 
> login: root
> 
> Password:
> 
> Login incorrect
> 
> [gopalghosh at localhost ~]$ su
> 
> Password:        {when I logged as su it accepted the same password}
> 
> [root at localhost gopalghosh]# sudo ls

there is no point doing "sudo ls" as root, as that command basically says "run 'ls' as root".

> Desktop  Documents Download  Music  Pictures Public  Templates  Videos
> 
> [root at localhost gopalghosh]# exit exit
> 
> [gopalghosh at localhost ~]$ sudo nano
> 
> We trust you have received the usual lecture from the local System
> 
> Administrator. It usually boils down to these three things:
> 
>     #1) Respect the privacy of others.
> 
>     #2) Think before you type.
> 
>     #3) With great power comes great responsibility.
> 
> [sudo] password for gopalghosh:
> 
> gopalghosh is not in the sudoers file.  This incident will be reported. 
> {how to add my local login in sudoers file}

check your /etc/sudoers file

for general use, there is no real need for sudo. You might need it in a multi-user environment where you want someone to 
have access to some higher-level functions but not to know the root password.

however, in a one-user environment (a laptop is usually single-user), there's no real point using sudo.

personally, I either su to root, or run something like this:
su -c ls

this is just my opinion - perhaps other people have good reasons to use it.

kae




More information about the Fedora-laptop-list mailing list