LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-25-2004, 10:44 PM   #1
rwalkerphl
Member
 
Registered: Jun 2004
Location: NJ, US (Ex UK)
Distribution: RHEL3.0 / FC2
Posts: 79

Rep: Reputation: 15
Dumb question on setting path


Sorry for the dumb question, but where do I define the paths that will be set at boot up time? I am trying to set the path to xauth for vncserver without success right now...

Thanks,

Robin.
 
Old 10-25-2004, 11:02 PM   #2
kvedaa
Member
 
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
setting it in your .bash_profile file should do nicely... for more information take a gander at:

http://64.233.167.104/search?q=cache...+path%22&hl=en
 
Old 10-25-2004, 11:15 PM   #3
rwalkerphl
Member
 
Registered: Jun 2004
Location: NJ, US (Ex UK)
Distribution: RHEL3.0 / FC2
Posts: 79

Original Poster
Rep: Reputation: 15
Great - thanks. I am now starting to understand - if I log in as root, I need to set the path in the .bash_profile under /root. For other users, I have to set it in the .bash_profile in the /home/user_name directory.

Is there anywhere I can set it where it will always be picked up regardless of user?

Thanks!
 
Old 10-26-2004, 06:46 AM   #4
kvedaa
Member
 
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
I am not aware of any location that allows you to set a path that woud be applicable for all users. Part of the reason behind this the idea of security within unix/linux. In many (most?) distributions root will have a some what limited path listing. For example root will normail not include "." which would be your current working directory. This is to prevent the root user from accidently running a program that has been left in a user directory that has been given the same name as a traditional utility program.

I hope this makes some sense (I have just gotten out of bed...).
 
Old 10-26-2004, 08:30 AM   #5
rwalkerphl
Member
 
Registered: Jun 2004
Location: NJ, US (Ex UK)
Distribution: RHEL3.0 / FC2
Posts: 79

Original Poster
Rep: Reputation: 15
It does, but from a maintenance standpoint, I can see this could get out of hand if you need default paths for a group of users... or is it possible to set paths by group somehow?

In the meantime, I am running a server with Oracle Applications, and so only need applmngr and root pretty well, so the solution of setting the path in the bash file for the 2 uses is no problem. The penny dropped for me last night when you replied, so I feel at least I understand how it works...

Thanks.
 
Old 10-26-2004, 09:09 AM   #6
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Jessie; Centos 6; FreeBSD 9 & 10
Posts: 272

Rep: Reputation: 35
The overall system path is set in /etc/profile. The profiles in the home directories are generally extensions of it. You might see specific uid's mentioned in it to have portions of the path apply only to root or other users.
 
Old 10-26-2004, 10:37 AM   #7
rwalkerphl
Member
 
Registered: Jun 2004
Location: NJ, US (Ex UK)
Distribution: RHEL3.0 / FC2
Posts: 79

Original Poster
Rep: Reputation: 15
Great, thanks! I looked into the profile file, and realized I had tried to change it, but had added the path to the library path not PATH.

For some reason, I thought this was complex, but the more I use it, the easier it seems to understand it.

Thanks again,

Robin.
 
Old 11-03-2004, 03:14 PM   #8
ensnaregod
Member
 
Registered: Jul 2004
Location: tucson,AZ
Distribution: Debian
Posts: 37

Rep: Reputation: 15
Angry setting path for roo on a debian system

I couldn't log in to my box as root at all so I got some help and he tried to see if my shell was the problem and it ended up being my root folder. So he renamed root to root.hosed and made a new folder called root then I think thats all he did then he tried loging in and it worked. But i can't set the path for /sbin /usr/sbin /usr/local/sbin and if i type an absolute path it will work. So my question would have to be how to set the path only for root????? Oh yeah and when i log in it doesn't seem to be reading my .bashrc or any of the files that I can tell???? Any Ideas???



Thanks beforehand
James
 
Old 11-03-2004, 05:33 PM   #9
rwalkerphl
Member
 
Registered: Jun 2004
Location: NJ, US (Ex UK)
Distribution: RHEL3.0 / FC2
Posts: 79

Original Poster
Rep: Reputation: 15
Here is a copy of the .bash_profile that I have in the root directory:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/bin/X11R6
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH

I found that by adding paths here that the paths turned up in the root users path after re-boot.

I am also guessing that this is how the .bashrc is read as well based on the code calling the .bashrc shown above.

I hope this helps.

Robin.

Last edited by rwalkerphl; 11-03-2004 at 05:34 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
this might be a dumb question ericb Slackware - Installation 9 10-09-2005 04:39 PM
Dumb question rhraz Linux - Newbie 4 03-03-2004 08:37 AM
dumb a*s question Jetta-GT- Linux - Newbie 3 01-08-2004 06:58 AM
dumb question! Athlon_Jedi Linux - Newbie 6 05-20-2003 01:51 PM
dumb question Sveede Linux - Newbie 3 05-23-2001 06:59 PM


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