LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-12-2003, 08:56 PM   #1
bcarl314
Member
 
Registered: Jun 2003
Location: USA, Minnesota - Land of 10,000 lakes
Distribution: Red Hat 9, Mandrake 10
Posts: 56

Rep: Reputation: 15
Unhappy Set path at login


Ok, I'm suffering from stupidity at the moment.

I'm running RH9. I know there's a file that I need to modify so that when I login, my default path includes /sbin and /usr/sbin, but I can't remeber which file.

Can somebody pleae help? Thanks
 
Old 10-12-2003, 09:06 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
In your home directory, there's a .bash_profile. In it, there is a line...

PATH=$PATH:$HOME/bin

Append a ":/sbin:/usr/sbin" to the end, and you should be good to go.
 
Old 10-13-2003, 09:36 AM   #3
bcarl314
Member
 
Registered: Jun 2003
Location: USA, Minnesota - Land of 10,000 lakes
Distribution: Red Hat 9, Mandrake 10
Posts: 56

Original Poster
Rep: Reputation: 15
Hmm, that solution works great if I log out and come back in, but it doesn't set the appropriate path when I su from user to user. Is there something in the /etc/skel directory or some where else?

Basically the problem I've got is when I login as a regular user, I don't have /sbin and /usr/sbin in my path, which is fine, but when I su to root, I don't have that either, which I need to do admin stuff. Sooo, what I'd like to happen is have /sbin and /usr/sbin added to my path only when I'm root.
 
Old 10-13-2003, 10:46 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
If you want the persons full path when su'ing to them, place a - after su, like this:

su - username

or

su - root

or just a simple

su -

And that should give you their complete path that they have in their bashrc or bash_profile file, etc.
 
Old 10-13-2003, 01:48 PM   #5
bcarl314
Member
 
Registered: Jun 2003
Location: USA, Minnesota - Land of 10,000 lakes
Distribution: Red Hat 9, Mandrake 10
Posts: 56

Original Poster
Rep: Reputation: 15
Perfect! Thanks
 
  


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
how to set my so path? hongxing Linux - Software 1 10-20-2005 03:23 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 03:52 AM
$PATH!? how to set these PATH(s)!? sirpelidor Red Hat 5 10-25-2003 05:00 PM
How to set $PATH for RH 8 Quest Linux - Software 3 07-12-2003 11:58 AM


All times are GMT -5. The time now is 11:04 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