LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-22-2003, 04:45 PM   #1
braindeadt
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
Question login probs with ENV-files


hi i have a problem with logging into linux

everytime when i login the /etc/profile and then the /home/username/.profile are executed
even if i change the user with:
su - username

but if i change the username with:
su username (without "-")
none of these files are executed

so my questions are:
what is the different between changing user with "su - username"
and "su username" ?

and are there any files wich are executed when i use "su username" ?
 
Old 04-22-2003, 05:07 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
When you use "su -" you create a new shell started by that user for working in.

There aren't any programs executed by a normal su but you can use su to run a program as another user like:
su - -c "iptables -L"

In this case you would get the iptables rule listing.

Edit: perhaps this is a better example:
su root -c "/sbin/iptables -L"

Last edited by david_ross; 04-22-2003 at 05:11 PM.
 
  


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
login probs dominicj Linux - Software 2 04-23-2005 09:05 PM
NIS login probs on debian PeterN Linux - Software 4 01-06-2004 10:12 AM
login probs burkie Linux - General 3 04-24-2003 08:11 AM
login screen probs amnesiac Linux - General 2 04-15-2003 12:51 PM
Complete Newbie, login probs clyne Linux - Newbie 8 07-28-2001 03:29 PM


All times are GMT -5. The time now is 12:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration