LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Strange super-user problem (https://www.linuxquestions.org/questions/linux-newbie-8/strange-super-user-problem-166370/)

Riichard 04-05-2004 06:23 AM

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.

qwijibow 04-05-2004 06:59 AM

maybe roots PATH variable is not set correctly ?

Riichard 04-05-2004 07:14 AM

Quote:

Originally posted by qwijibow
maybe roots PATH variable is not set correctly ?
Sounds likely, how would I go about correcting this?

qwijibow 04-05-2004 10:15 AM

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

Riichard 04-05-2004 12:24 PM

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:

qwijibow 04-05-2004 04:55 PM

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 ?

Riichard 04-05-2004 06:06 PM

Quote:

Originally posted by qwijibow
so... has your roots path variable been set at all ?
Doesnt look like it. I used Redhat 9 for about 6 months and never had this problem.


Quote:

Originally posted by qwijibow
you do understand that $HOME is a variable equal to /home/logged_in)user_name right ?

Yes, I searched for *bash_profile* everywhere and its not there :confused:

qwijibow 04-06-2004 03:59 PM

thats a .bash_profile { (DOT)bash_profile }

gregaryh 04-06-2004 05:24 PM

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 03:25 PM.