LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-14-2005, 08:38 AM   #1
jalldridge
Member
 
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???

Thanks
 
Old 04-14-2005, 08:43 AM   #2
jxi
Member
 
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).

su
gives you root but still with the user environmental settings.
 
Old 04-14-2005, 08:43 AM   #3
ahh
Member
 
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
jalldridge
Member
 
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
anjanesh
Member
 
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
timmeke
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).
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:11 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration