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 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 |
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... |
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...
|
Check the user's entry in /etc/passwd.
Also, check their .bashrc, .bash_profile? /etc/profile ? |
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. |
All times are GMT -5. The time now is 01:45 AM. |