Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-23-2014, 07:28 PM   #1
Registered: Jul 2004
Location: Alabama, USA
Distribution: OpenSuse 12.1
Posts: 66

Rep: Reputation: 15
SSH Terminal Closes After Logging In...


I'm using Ubuntu Server 13.10. Everything has been fine until I started adding users to groups. The user will open Putty in Windows, connect to the server, enter username and password, and Putty immediately closes. Suspecting a potential Putty issue I rebooted and no change.

I created a custom group called sftp and added myself to that group. After that I was no longer able to SSH in due to the above explanation. I was able to log in locally to the server, but not SSH. So I removed myself from the sftp group and whola, I was able to log in again via SSH.

I've checked the /etc/passwd file for nologin on users, and that's not the issue. This also occurs if I add a user to built-in ftp group. I have checked /var/log/auth.log and it only says the user successfully logged in, never shows anything about the disconnect right after logging in.

Any advice would be helpful!
Old 01-23-2014, 09:12 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
By any chance, is your ssh configuration set up to either deny access to users in the sftp group or chroot them to their home directory? You can look at /etc/ssh/sshd_config and see if the sftp group has any such restrictions placed on its members.
1 members found this post helpful.
Old 01-24-2014, 12:10 AM   #3
Registered: Jul 2004
Location: Alabama, USA
Distribution: OpenSuse 12.1
Posts: 66

Original Poster
Rep: Reputation: 15
btmiller, you are the man! (or gal?) When you said that it dawned on me what the issue could be. I've set up this server to provide many services to different users which I've focussed a lot on security. I've set up SSH, SFTP, FTP, Samba, NFS, Apache and more on this server. The problem was I restricted users in sshd_config and only allowed SSH and SFTP to use SSH. Then I modified their profile in passwd removing their shell. Well, this created different login denial scenarios. It either would say Access Denied or simply close the Putty window. Now I understand why because I was chrooting certain groups.

Anyway, I've got it screwed up and now know what to do to correct it. Thank you again!


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] need bash script to close terminal when program closes rrrssssss Programming 5 09-25-2013 04:17 PM
[SOLVED] Terminal emulator closes immediately when start with normal user Skelray Linux - Software 3 08-13-2013 09:04 AM
bash: detect when terminal prompt returns after app window closes thaitang Programming 1 05-02-2013 04:13 AM
SSH closes connection before login goose240 Linux - Networking 4 02-14-2005 05:14 AM
Terminal window closes when task completes JohnKFT Slackware 2 12-21-2004 12:07 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration