LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-20-2005, 03:15 PM   #1
mojarron
Member
 
Registered: Mar 2005
Location: ol mexico
Distribution: Slackware10.1 | KDE3.3.2 | Kernel 2.4.29
Posts: 34

Rep: Reputation: 15
Question 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?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-20-2005, 03:26 PM   #2
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
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.
 
1 members found this post helpful.
Old 03-20-2005, 03:59 PM   #3
mojarron
Member
 
Registered: Mar 2005
Location: ol mexico
Distribution: Slackware10.1 | KDE3.3.2 | Kernel 2.4.29
Posts: 34

Original Poster
Rep: Reputation: 15
o, i see

thanks a lot ahh
 
Old 03-20-2005, 10:48 PM   #4
xgreen
Member
 
Registered: Aug 2003
Distribution: Slackware,Ubuntu
Posts: 389

Rep: Reputation: 30
"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
 
3 members found this post helpful.
Old 03-23-2005, 07:14 AM   #5
marsguy
Member
 
Registered: Nov 2004
Distribution: Red Hat Enterprise & SuSe 10
Posts: 77

Rep: Reputation: 15
thank you so much nazmin

you've been of great help!
 
Old 12-05-2009, 07:50 PM   #6
linuxhantu
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
Smile

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

Last edited by linuxhantu; 12-07-2009 at 03:55 AM. Reason: Dead Threat....wrong forum posting
 
Old 12-06-2009, 12:46 PM   #7
windtalker10
Member
 
Registered: Nov 2007
Location: Kentucky
Distribution: Slackware13.1
Posts: 214

Rep: Reputation: 38
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.
 
Old 12-06-2009, 04:57 PM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,887

Rep: Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774
Quote:
Originally Posted by windtalker10 View Post
Su is short for super user.
I've heard that before, which is surprising considering what the man page says on the subject:
Quote:
su - run a shell with substitute user and group IDs
and thinking of it as the 'super user' command is a bit odd when you consider that you can switch to users other than root.


Quote:
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.
Or, log out and log in, rather than rebooting.

Quote:
sudo is nothing more than another path to becoming a super user.
from the man page:
Quote:
sudo allows a permitted user to execute a command as the superuser or another user
So, primarily, sudo is for when you want to run a single command, and su is when you want to run a succession of them.

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.
 
Old 12-06-2009, 05:01 PM   #9
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,191

Rep: Reputation: Disabled
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
 
0 members found this post helpful.
Old 12-07-2009, 04:08 PM   #10
windtalker10
Member
 
Registered: Nov 2007
Location: Kentucky
Distribution: Slackware13.1
Posts: 214

Rep: Reputation: 38
Quote:
Originally Posted by Alien Bob View Post
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
Geez! I didn't even notice the date of the op!
I will from now on though.
 
  


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
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 09:40 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
LDAP object classes: cn=admin, why "simpleSecurityObject" and "organizationalRole&quo Hko Linux - Networking 0 08-06-2004 07:55 AM
"User" & "System" CPU load difference JJX Linux - General 3 06-06-2004 01:42 AM


All times are GMT -5. The time now is 01:51 PM.

Main Menu
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