Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-14-2005, 08:38 AM   #1
Registered: Mar 2005
Location: South East England
Distribution: Mandrake 10.1 Discovery
Posts: 34

Rep: Reputation: 15
Whats the difference between...

logging on as su and loggin on as su - ???

Why a possibly silly question - In a post on another forum I was told that it was important to log on as su - to start my adsl connection.

Any obvious differences between the two???

Old 04-14-2005, 08:43 AM   #2
Registered: Feb 2003
Location: Richmond VA
Distribution: Slackware 11 -- CentOS 4.4
Posts: 115

Rep: Reputation: 15
su -
puts you in the root environment (esp important here as the command to start adsl is probably in the PATH setup for root).

gives you root but still with the user environmental settings.
Old 04-14-2005, 08:43 AM   #3
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
If you use su you will retain the evironment of the user you su'd from, i.e. home directory, PATH, etc.

If you use su - you will have the environment of the user you su'd to.
Old 04-14-2005, 08:47 AM   #4
Registered: Mar 2005
Location: South East England
Distribution: Mandrake 10.1 Discovery
Posts: 34

Original Poster
Rep: Reputation: 15
That explains it all. Thanks.
Old 05-23-2006, 09:54 AM   #5
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Rep: Reputation: 30
Google brought be here.
So what would be advisable when I need to switch to admin mode for installation ? su or su - ?
Old 05-23-2006, 10:11 AM   #6
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
I'd say "su -". Both should work though.

Basically, when you are installing something and you need to run ie "make install" as root,
one of the things it does is copy the compiled application (compiled and linked via "make" typically) to
standard paths like /bin, /usr/bin, etc.
However, those directories are readable/searchable by everyone (so anyone can use the utils), but they're only writable by root (thus making root privilege necessary for installing stuff).
Changing these permissions to make the directories writable is a serious security hazard.

However, your environment settings probably don't play a role when "make install" is copying programs into
/bin, etc (cp only needs to be run under root user to have the write access).


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
whats the difference?? its_toby General 4 10-11-2005 10:35 PM
Whats the difference between X and Xfree? Jmcatch742 Linux - General 4 11-04-2004 06:18 AM
Whats the difference... johnsonb125 Linux - Newbie 3 05-19-2004 11:09 PM
whats the difference? sixth_sense Linux - Security 1 04-29-2004 06:28 PM
whats the difference between Distrobutions ? qwijibow Linux - Newbie 8 06-26-2003 02:00 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration