LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   SU Odd Problem (https://www.linuxquestions.org/questions/linux-general-1/su-odd-problem-675530/)

AsgAnquietas 10-10-2008 02:04 PM

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

Unknown_User 10-10-2008 04:48 PM

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...

AsgAnquietas 10-11-2008 01:45 AM

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...

chrism01 10-12-2008 08:19 PM

Check the user's entry in /etc/passwd.
Also, check their .bashrc, .bash_profile?
/etc/profile ?

Dimetra 10-12-2008 10:44 PM

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.