LinuxQuestions.org
Visit Jeremy's Blog.
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 10-10-2008, 02:04 PM   #1
AsgAnquietas
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Rep: Reputation: 0
Exclamation SU Odd Problem


Well, I have a very odd problem :|

I have multiple user accounts on a system... when I try to su- from root into another simple account, bash gives me the green colored prompt... ok, but when I type just 1 letter, it automatically fills in "logout" or "exit" and it logs me off instantly...
I reboot the computer, and when I su-, it works, I can type commands in the simple account's shell, I logout, and when I su- back, it automatically logs me out... I don't know what is this...

I've already checked, the permissions are set, the user's home directory exists, everything is otherwise ok.

I have to mention also that in normal direct logins on the simple users, it works, and even in ssh simple_user@server it also works.

The only problem is in SU- from root into the normal user.

Code:
maincore ~ # su - backup
backup@maincore ~ $ wlogout
maincore ~ #
that "logout" you see, is NOT my typing... I just typed "w", I don't know why, it automatically appends a logout or an exit to my shell when I start typing the first letter of a command :|

The only wait to counteract this is to hit Enter and start typing afterwards, but this is not a solution.. I want a permanent solution and an explanation if possible

Please advice

Last edited by AsgAnquietas; 10-10-2008 at 02:06 PM.
 
Old 10-10-2008, 04:48 PM   #2
Unknown_User
Member
 
Registered: Jan 2003
Location: EU (UK)
Distribution: Ubuntu 10.x, Fedora 9, OpenSuSE 11.3, Mythbuntu (Don't know it? Try - it rocks!)
Posts: 225

Rep: Reputation: 30
How very strange!

Just a guess but is your TMOUT variable set very low in your /etc/profile or /etc/.bash_profile?

This is the value in seconds as to how long bash will wait before automatically logging out the user if no input is made. If it is set very low then (perhaps?) you are always being logged out.

Hopefully someone will have seen this before...
 
Old 10-11-2008, 01:45 AM   #3
AsgAnquietas
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Original Poster
Rep: Reputation: 0
It is not a time value, because I can stay hours on the shell if I don't type something... the second I type a character it logs me out if I not hit a couple of Enters...
 
Old 10-12-2008, 08:19 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Check the user's entry in /etc/passwd.
Also, check their .bashrc, .bash_profile?
/etc/profile ?
 
Old 10-12-2008, 10:44 PM   #5
Dimetra
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
I have the same problem with one of my servers, which is running Gentoo 2.6.25-hardened-r7 and bash 3.2.33(1)-release. The only major difference between this machine and my other Gentoo machines is that it runs hardened Gentoo. Not sure how relevant that fact is.

On my machine, it only happens while running su as root. Normal users can su with no difficulties. Also, it happens regardless of the user that root tries to su to.

Like the original poster, I can work around the problem by pressing Enter immediately after becoming the new user (i.e. sending a blank command line). If I fail to remember to do so, then "exit" is printed after the first keystroke and I am immediately logged out. I can stay logged as the new user indefinitely, providing that I do not type. This very much hinders productivity.

I have checked the profile and rc files, and found nothing unusual. I have tried replacing the files with default files. I have tried creating new users. I have checked permissions and ownership of /bin/bash and other relevant files. I've watched log files, which show entries typical of a normal log in/out. None of these attempts has fixed the problem.

Both "su USERNAME" and "su -l USERNAME" result in similar behavior. Running "su -c" usually works, but I have seen it fail in scripts resulting in permission errors and/or "bad interpreter".

I hate to post a "me too", but thought some additional info might be useful. Besides, miserly loves company.

Any pointers would be greatly appreciated.

Last edited by Dimetra; 10-12-2008 at 11:45 PM. Reason: Added more info about attempted fixes
 
  


Reply

Tags
bash, shell, su


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd Problem brpyne Linux - General 3 07-25-2006 11:07 PM
Odd problem with X gotgnu Slackware 3 09-24-2005 06:19 PM
An odd problem Enochian Linux - Software 5 06-03-2004 09:05 AM
Odd problem Catalinus Linux - Networking 4 10-09-2002 12:42 PM
An odd problem moger Linux - Hardware 5 09-25-2002 09:42 PM


All times are GMT -5. The time now is 11:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration