newbie question: whats the difference between "su root", "su" and "su -&quo
with all of them i get a password prompt for root, is there any difference between them?
|
su root is the default command for su.
That is, if you type su it will assume you mean su root. To su to another user you will have to add the users name, e.g. su username. If you use su you will still have the same envioroment, for example the $PATH variable, as the user who su'd. If you use su - you will have the envioroment of the user you su'd to. |
o, i see
thanks a lot ahh |
"su" is equiv "su root" and "su -" equiv "su - root"
the diff between "su" and "su -" is "su -" you log in as a root with the env setting/profile (i.e you really log in as a root). just type "pwd" and you will be in the root home dir @ /root. if you "su" only then basically you just "borrow" the root permission without having all the root env setting/profile . just "su" from your home dir and type "pwd", you can see that you still in the user dir i.e /home/user |
thank you so much nazmin
you've been of great help! |
Anyway, I thinks the main differences are path (su - root have env path of /sbin and/usr/sbin) that make ones have the rights to run commands
wow. I think the discussion of this topic is fruitful, I am compile it over to my website and added few example. I hope this is ok and does not violate forum's rules You might find the website a bit lack of info at this moment, sorry guys I compiling and start writing on the site |
They're just different paths to get to the same destination.
Su is short for super user. You'll use it when you're logged in as a user and wish to do something that requires root privileges. Using su or sudo [to name a couple commonly used]is the only way to access root privileges while logged in as a user unless one wishes to reboot and log in as root. To time consuming and a pita to do. If you happen to be using a kde desktop, at times you may also be required to use kdesu to gain root privileges as needed while logged in as user. kdesu is the kde equivalent of su. sudo is nothing more than another path to becoming a super user. sudo has to be set up if using Slack,, at least in 12.2. I myself have seldom if ever had the need for it. I've only used kdesu once in Slack and then it was to set up hplip. If you're not logged in at all, but are at the log in stage and wish to accomplish something that requires root privileges, then you have the option to log in as root. A good reason to log in as root would be to set up a user account so you don't have to log in as root. It's just to make things easier for a person to run as user instead of root yet provide an easy way to access root when needed. |
Quote:
Quote:
Quote:
Quote:
Quote:
The argument for having su/sudo is that if you don't have this kind of facility, you'll log in as root for most things, because you might have to do something as root, and doing everything as root is bad. |
Please! Do not try to resurrect long-dead threads. This one was dead for 4.5 years.
@linuxhantu: do not try to advocate your CentOS fansite on a Slackware forum. As if we care. Eric |
Quote:
I will from now on though. |
All times are GMT -5. The time now is 03:27 PM. |