LinuxQuestions.org
Review your favorite Linux distribution.
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 02-26-2003, 01:40 PM   #1
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Rep: Reputation: 15
really weird!!! su doesn't work right


hey all, I have a RH7.3 box, and for some reason recently, whenever I am logged in as a normal user and issue su, it asks for password. I type it in and it goes through. However, I cannot edit any files, cannot issue a lot of the commands. But the weird thing is, if I log directly in as root (instead of su) everything works fine. Any thought??? Thanks in advance
 
Old 02-26-2003, 01:51 PM   #2
zulu1_hl
LQ Newbie
 
Registered: Aug 2002
Posts: 7

Rep: Reputation: 0
Try using "/bin/su - root" to bring in the root user's environment when switching from another user.
 
Old 02-26-2003, 04:47 PM   #3
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
no luck, thanks though. It's really starting to frustrate me!!!
 
Old 02-26-2003, 05:04 PM   #4
Texicle
Member
 
Registered: Oct 2002
Location: Northern Ontario, Canada
Distribution: Slackware 10.0
Posts: 789

Rep: Reputation: 30
When at command prompt do you type "su" or "su -" (without the quotes)? If just su, then try:

su -

I would suggest checking that your user account has permission to "su" but you've already stated that you can su to root, but can't do root stuff. This is really bizarre. Are you doing this in a terminal console in X or in just plain command line terminal? Try getting out of X and logging in as your user then "su -" and see what happens. If it works without X, it might be your Xterm (or whatever console you're using) that has problems.

Additionally, when you su - to root, you no longer stay in the directory that your user account was in--you go to the root's home directory. If, as granny, you're in /home/granny, your prompt should look similar to:

[granny@hostname]~$

Then, you do su, or su - you'll get:

[root@hostname]~#

For the sake of example I'll say you're using the vi text editor. Now you want to edit a file that is located in /home/granny and you just type:

[root@hostname]~# vi somefile

You'll get a new file generated as it doesn't exist there. You'll have to add the path to the file as follows:

[root@hostname]~# vi /home/granny/somefile

If you want to stay in the same directory as your user before the switch to root type:

su -m

The only reason I'm suggesting this is because I've made this mistake more than a few times when installing software from source. Hope this helps.

Last edited by Texicle; 02-26-2003 at 05:05 PM.
 
Old 02-26-2003, 05:23 PM   #5
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
It happens in both X window and through an actual console without X running. Even if I shut off X (init 3) I'll give it a shot. Thanks
 
  


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
suse 10: rpm install of programs does not work and then i get some weird directories kilroy05 SUSE / openSUSE 1 10-14-2005 06:00 AM
weird, weird problems with logitech precision USB gamepad ikataii Linux - Hardware 4 10-14-2005 05:31 AM
Weird! ATI Drivers work only after logout, followed by "startx" in prompt pitchaxistheory Mandriva 1 10-14-2004 06:51 PM
Weird, weird apache2 problem atheist Debian 1 09-17-2004 09:26 PM
wine wont work..weird error akudewan Linux - Software 8 07-19-2004 09:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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