LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2008, 04:01 PM   #1
Rauldinho
LQ Newbie
 
Registered: Nov 2004
Posts: 20

Rep: Reputation: 0
SSH closes the connection right after the authentication


Hi i'm trying to connect trough ssh to a web server but everytime i do the server closes the connection. Here's the output:

cvgin@monitoreo:~$ ssh -v user@<ip-direction>
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to <ip-direction> [<ip-direction>] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/identity type -1
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian-8.sarge.6
debug1: match: OpenSSH_3.8.1p1 Debian-8.sarge.6 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '<ip-direction>' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/identity
debug1: Offering public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive


Password:
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = es_VE.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Linux web01 2.6.15-1-sparc64 #2 Thu Mar 9 00:47:20 UTC 2006 sparc64 GNU/Linux

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.

Last login: Thu Sep 4 08:31:08 2008 from source-ip
debug1: channel 0: free: client-session, nchannels 1
Connection to <ip-direction> closed.
debug1: Transferred: stdin 0, stdout 0, stderr 38 bytes in 0.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 3058.9
debug1: Exit status 1

Can anyone help me on this one??? Thanks in advanced!
 
Old 09-04-2008, 04:35 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
This behavior is exactly what you'll see if the first line of your .bash_profile on the target machine says "exit". I just tried that with one of my logins on a Debian box and I got identical output from my ssh -v attempt.

You are getting past authentication and initial login MOTD ("message of the day") and dieing after that. The typical next steps after running through /etc/profile are your personal .bash_profile and .bashrc Those are the first places I'd check (or course, if you can't login to the box in the first place, it may be difficult to check these!) Could be the sysadm put /dev/null as your shell in /etc/passwd (or something similar).
 
Old 09-05-2008, 08:34 AM   #3
Rauldinho
LQ Newbie
 
Registered: Nov 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Hi, thanks for your answer. I check the /etc/passwd file and the user didn't have anything in the shell field. I did an usermod and put a /bin/bash/ and it work's now, thanks for your help!
 
  


Reply



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
connection closes with vsftpd jknixon Linux - Networking 4 02-28-2008 10:26 AM
jailkit closes ssh session xilace Linux - Software 7 10-07-2006 11:20 AM
SSH closes connection before login goose240 Linux - Networking 4 02-14-2005 04:14 AM
qmail prematurely closes connection when trying to telnet... ivj Linux - Software 0 07-25-2004 04:47 AM
ls command closes sftp connection SpecialK5106 Linux - Networking 4 11-03-2003 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:58 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