LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-02-2003, 03:43 AM   #1
UB_KMA
Member
 
Registered: Jul 2002
Location: Austin,TX
Distribution: A mash of SourceMage, Lunar, Slack, Manny, and RedHat all smushed together
Posts: 94

Rep: Reputation: 15
path as su


trying to give su the proper path access while in a bash shell from a user account...my profile in /etc says:
PS1="${USER}@${HOSTNAME}>"
umask 0022
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/local/kde/bin:/usr/local/qt/bin:/usr/local/jdk/bin
export PS1 PATH HISTSIZE QTDIR KDEDIR LS_COLORS QT_XFT TERM

The .bash profile in the user account I need su path properly set up in says:
# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

Curently, when su as root within a user account there seems to be no path setup for root.
Any suggestions on how to correct this are appriciated!
 
Old 01-02-2003, 03:44 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
When you su, you need to add the - at the end:
su -

This adds the path variable as well AFAIK.

Cool
 
Old 01-02-2003, 03:55 AM   #3
UB_KMA
Member
 
Registered: Jul 2002
Location: Austin,TX
Distribution: A mash of SourceMage, Lunar, Slack, Manny, and RedHat all smushed together
Posts: 94

Original Poster
Rep: Reputation: 15
ah, thanks much!
 
Old 01-02-2003, 04:01 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
You're welcome
 
Old 01-28-2003, 02:25 AM   #5
Atreyou40
LQ Newbie
 
Registered: Jan 2003
Location: Houston
Distribution: Red Hat
Posts: 8

Rep: Reputation: 0
Lightbulb Thanks Master C

Master C,

Thanks for posting the answer, but for the record, how do I actuall edit the path? How exactly do you change the path variable? On this line of the .bash_profile file:

PATH=$PATH:$HOME/bin

because when I type $PATH at the command line, it gives me a MUCH longer path, I'm sure you know what I'm talking about, and I can find that path nowhere in the NHF file on editing your bash_profile. The NHF alludes to the fact that you need to change these files to get it done but never actually covers it. I even tried $PATH at the command line as well, and typing 'export' and then my new path - this was the advice of my dense buddies - but nothing worked. Your post answered my question and for grins I checked the man page for su, and there it is in black and yellow:

"A mere '-' implies -l. If no $USER is given, assume root"

Amazing things those man pages, but they never make much sense till someone explains them to you.
 
Old 01-28-2003, 02:38 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Re: Thanks Master C

Quote:
Originally posted by Atreyou40
How exactly do you change the path variable?
Well it's different on each distro it seems. On my Slack system all I do is edit /etc/profile There is an obvious line in there that I add the new entry to. On other systems it appears to be in /etc/profile.d You also can do the bash_profile deal, but I do believe that would only work if you are using bash, which to me isn't a great way to edit something.

I don't normally have a great need to add/remove from my default path variable all that often, so if I point someone towards a way to do it (on either Mandrake or RH) I usually point towards this how-to:
http://www.mandrakeuser.org/docs/utils/ujava.html

Also, you might get something out of this amazingly long thread:
http://www.linuxquestions.org/questi...threadid=33091

Anyway, to make this long story short, I don't know. However, many people on this site do, and a search might reveal quite a bit.



Cool
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 07:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 05:07 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 02:23 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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