LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-24-2012, 06:41 PM   #1
Baldho
LQ Newbie
 
Registered: Jun 2004
Posts: 12

Rep: Reputation: 0
Get logged out immediately after login (TTY and SSH)


Hi!

I have a Debian linux booting via PXE. The pxe server works fine for my other PXE booted distributions. Only this one, which was working fine before I had to use a backup, when I log in via terminal or ssh, I immediately get logged out.

SSH says Connection closed by remote host

and on terminal, the login succeeds and I get the welcome message but before I even get a prompt, I fall back immediately to the username prompt.

I guess it's a permission problem but using the server I went to see some log file but couldn't find anything useful other than notifications of login and logout. I'm really lost.

Can anyone help?
Thanks
 
Old 07-24-2012, 07:13 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,038

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Hi,

are you sure there is nothing useful in the log files? Since you were able to check the log files at least one user must be able to log in. Is it only one user that can not login?

Do the restored files have the correct permissions and ownership? This type of behaviour can occur if a user does not have sufficient permissions in their home dir.

Evo2.
 
Old 07-24-2012, 07:27 PM   #3
Baldho
LQ Newbie
 
Registered: Jun 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for replying!

Both root and the "son" user log in with the same result.

I can check the logs because the problem is on the client machine (booting with PXE) and its files are all on my server which works fine

I've checked the home permissions against another working distribution and they seem fine.

Here what I can gather:

Quote:
ssh son@192.168.0.11
son@192.168.0.11's password:
Linux son 2.6.32-5-686 #1 SMP Mon Jun 13 04:13:06 UTC 2011 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Tue Jul 24 01:21:23 2012
Connection to 192.168.0.11 closed.
user.log:
Quote:
Jul 24 01:06:08 son login[1616]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Jul 24 01:06:08 son login[1616]: pam_unix(login:session): session closed for user root
Jul 24 20:44:08 son sshd[1511]: Accepted password for son from 192.168.0.44 port 53479 ssh2
Jul 24 20:44:08 son sshd[1511]: pam_unix(sshd:session): session opened for user son by (uid=0)
Jul 24 20:44:08 son sshd[1514]: Received disconnect from 192.168.0.44: 11: disconnected by user
Jul 24 20:44:08 son sshd[1511]: pam_unix(sshd:session): session closed for user son
/root:
Quote:
drwx------ 3 root root 4096 Jul 24 01:20 root
/home:
Quote:
drwxr-xr-x 3 root root 4096 Jul 12 2011 .
drwxr-xr-x 21 root root 4096 Jul 12 2011 ..
drwxr-xr-- 3 baldho baldho 4096 Jul 24 00:34 son
I've tried chmod -R o+rwx on /home/son and it didn't change anything.
 
Old 07-24-2012, 07:54 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,038

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Hi,

/home/son appears to be owned by baldho and "chmod -R o+rwx /home/son" will only set these permissions for baldho. Or is this because the uid of baldho on the pxe server and the uid of son on the pxe client are the same?

I can't see anything that would appear to cause problems for root login.

Evo2.
 
Old 07-24-2012, 08:00 PM   #5
Baldho
LQ Newbie
 
Registered: Jun 2004
Posts: 12

Original Poster
Rep: Reputation: 0
Yeah this is what I figured out about the UID and GID. It's either 500 or 1000, can't remember.

chmod o is for other. chmod u is for the user

And the root account having the same problem would rule out the home permissions possibility...
 
Old 07-24-2012, 08:06 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,038

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Hi,
Quote:
Originally Posted by Baldho View Post
Yeah this is what I figured out about the UID and GID. It's either 500 or 1000, can't remember.
Hmm.
Quote:
chmod o is for other. chmod u is for the user
Doh. In my mind if often think of "o" for owner... which is wrong.
Quote:
And the root account having the same problem would rule out the home permissions possibility...
Yeah I guess so... sorry I'm out of ideas.


Evo2.
 
  


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
[SOLVED] ssh connection closed immediately after logged in gqqnbig Linux - Networking 3 07-02-2011 04:05 AM
change of TTY logged in linux? clifford227 Linux - Newbie 2 07-20-2010 11:38 AM
Disable root login, but still be able to sudo -s after logged with another user (ssh) ytd Linux - General 12 04-25-2010 11:34 AM
SSH quits immediately after login BrandonChristel Linux - Software 6 02-28-2008 06:38 PM
Changing assigned TTY for logged in users karnick Linux - General 0 03-02-2005 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:14 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
Open Source Consulting | Domain Registration