LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   just a quicky...(su-ing) (https://www.linuxquestions.org/questions/linux-newbie-8/just-a-quicky-su-ing-42617/)

salparadise 01-24-2003 09:18 AM

just a quicky...(su-ing)
 
can anyone tell me if there's a difference between su and su root ?

and if there is, is it important ?

many ta's

Mik 01-24-2003 09:30 AM

default if no name is specified is to su to the root user. So no there is no difference between those two commands.

There is however a difference in adding the - or not. Without it you won't really login as root and you won't get the root environment. So you would probably want to do 'su -' for most cases. Might want to read the man pages for more info.

jglen490 01-24-2003 04:40 PM

Mik is absolutely correct.

With su, by itself, you get root permissions, but with su - you get the root path environment also. The difference being that without the path environment, finding and executing root permissioned executables becomes more of a problem.

What I always do when I need root access at the CLI when I'm my "normal" user:

su -

<Respond to password prompt>

<Do what I need to do>

exit

And I'm back to my "normal"user.


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