LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   su (https://www.linuxquestions.org/questions/ubuntu-63/su-519534/)

tripled2006 01-15-2007 01:50 PM

su
 
Hi,

I have a weird problem. When I open a terminal, i can gain root access by issuing the command:

sudo -s

I am then asked for a password and enter the password with which i set up ubuntu on my system.

However, when i issue a su command, i am again prompted for a password. I enter the same password as before, but i am give an 'authentication error' message. why is this?

also, what is the difference between su and sudo -s?

Thanks to you all who took the time to read/reply to my query.


Thanks,


Dan.

mcmillan 01-15-2007 02:10 PM

su is used to switch the user. Just su by itself gives root access though if you have multiple users it can be followed by the username to switch to other users as well.

sudo was originally meant for giving limited privileges to users without having to actually give them the root password. Ubuntu has disabled the root password and gives the first user you create the ability to issue all commands using sudo. If you want to reenable the root password for some reason (I prefer it due to habits from other linux distros) this can be done by typing sudo passwd. First type your user password, then it will ask for a new password that is just used for root.

sudo -s is pretty much the same as issuing su, though in ubuntu it's the only way to switch to a root terminal unless you setup the seperate root passwod like I just described.

If you want more information look at man su and man sudo. In general typing man followed by a command will give information about the command


All times are GMT -5. The time now is 08:15 PM.