Strange super-user problem
Hi all
I'm having a problem with my SuSE9 that I never experienced with Redhat. I can open files from the command line as user only, not as root skynet@linux:~> gedit /etc/fstab This works as it should skynet@linux:~> su Password: linux:/home/skynet # gedit /etc/fstab bash: gedit: command not found I emailed a friend about this and he suggested 'su - root' This brings up a gtk warning linux:~ # gedit /etc/fstab (gedit:2308): Gtk-WARNING **: cannot open display: I get similar errors if I try kwrite instead of gedit. |
maybe roots PATH variable is not set correctly ?
|
Quote:
|
as a normal user, run 'echo $PATH'
and do the same as root. there will be a few strings in roots path that are not in the users path (the /sbin stuff) but every string in the users PATH should also be in the roots PATH. the path variable is set in $HOME/.bash_profile if it is the PATH variables fault, edit the bash profile file. my root path is... /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin |
This is the problem kwrite & gedit are not in the root path.
Ive searched for $HOME/.bash_profile and this file doesnt exist on my pc :confused: |
so... has your roots path variable been set at all ?
where is the path variable set in suse ? you do understand that $HOME is a variable equal to /home/logged_in)user_name right ? |
Quote:
Quote:
|
thats a .bash_profile { (DOT)bash_profile }
|
SuSE uses .bashrc in the $HOME directory for user profiles and uses /etc/profile.local for root and global changes. You can create a .bashrc file in /root that contains export PATH=<your path>
Also the error that says it can't open the display can be fixed by adding localhost to your xhosts list: As your regular user open a terminal window and type xhost +localhost you should then be able to run X apps as root without the display warning. You could also add this to your .bashrc file. |
All times are GMT -5. The time now is 02:18 AM. |