LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-05-2004, 06:23 AM   #1
Riichard
Member
 
Registered: Sep 2003
Location: 3rd Rock
Distribution: Mepis 6.5.02
Posts: 106

Rep: Reputation: 15
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.
 
Old 04-05-2004, 06:59 AM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
maybe roots PATH variable is not set correctly ?
 
Old 04-05-2004, 07:14 AM   #3
Riichard
Member
 
Registered: Sep 2003
Location: 3rd Rock
Distribution: Mepis 6.5.02
Posts: 106

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by qwijibow
maybe roots PATH variable is not set correctly ?
Sounds likely, how would I go about correcting this?
 
Old 04-05-2004, 10:15 AM   #4
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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
 
Old 04-05-2004, 12:24 PM   #5
Riichard
Member
 
Registered: Sep 2003
Location: 3rd Rock
Distribution: Mepis 6.5.02
Posts: 106

Original Poster
Rep: Reputation: 15
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
 
Old 04-05-2004, 04:55 PM   #6
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
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 ?
 
Old 04-05-2004, 06:06 PM   #7
Riichard
Member
 
Registered: Sep 2003
Location: 3rd Rock
Distribution: Mepis 6.5.02
Posts: 106

Original Poster
Rep: Reputation: 15
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
 
Old 04-06-2004, 03:59 PM   #8
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
thats a .bash_profile { (DOT)bash_profile }
 
Old 04-06-2004, 05:24 PM   #9
gregaryh
Member
 
Registered: Jan 2004
Location: Utah USA
Distribution: SuSE Pro 9.0
Posts: 43

Rep: Reputation: 15
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.
 
  


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
nfs write == super slow; read == super fast - problem? BrianK Linux - Networking 4 08-23-2007 11:59 PM
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 08:25 PM
Strange Networking Problem (super slowness) starcastic Linux - Networking 13 03-02-2005 07:10 PM
Super User boyinfrance Linux - Newbie 1 06-17-2002 01:07 PM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 10:58 AM


All times are GMT -5. The time now is 09:56 AM.

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