SFTP Issue - Connection closed


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SFTP Issue - Connection closed
# 8  
Old 08-19-2011
On both servers, OS is AIS and shell is korn shell.
# 9  
Old 08-22-2011
Code:
HERE ARE ADDITIONAL DEBUG STATEMENTS
=======================================================================================================


==> sftp -vvv USER2@REMOTE_SERVER2
OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Failed dlopen: /usr/krb5/lib/libkrb5.a(libkrb5.a.so): Could not load module /usr/krb5/lib/libkrb5.a(libkrb5.a.so).
System error: No such file or directory

debug1: Error loading Kerberos, disabling Kerberos auth.
debug2: ssh_connect: needpriv 0
debug1: Connecting to REMOTE_SERVER2 [170.49.18.117] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/USER2/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/USER2/.ssh/id_rsa type 1
debug1: identity file /home/USER2/.ssh/id_rsa-cert type -1
debug1: identity file /home/USER2/.ssh/id_dsa type -1
debug1: identity file /home/USER2/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.4
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v00@openssh.com,ssh-dss...00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 123/256
debug2: bits set: 512/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: host REMOTE_SERVER2 filename /home/USER2/.ssh/known_hosts
debug3: check_host_in_hostfile: host REMOTE_SERVER2 filename /home/USER2/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: host 170.49.18.117 filename /home/USER2/.ssh/known_hosts
debug3: check_host_in_hostfile: host 170.49.18.117 filename /home/USER2/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'REMOTE_SERVER2' is known and matches the RSA host key.
debug1: Found key in /home/USER2/.ssh/known_hosts:1
debug2: bits set: 499/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/USER2/.ssh/id_rsa (20041eb8)
debug2: key: /home/USER2/.ssh/id_dsa (0)
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/USER2/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp a6:c4:a1:2e:ef:63:73:f3:87:25:de:3a:2c:7c:64:63
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug2: fd 4 setting O_NONBLOCK
debug3: fd 5 is O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug1: Sending subsystem: sftp
debug2: channel 0: request subsystem confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: subsystem request accepted on channel 0
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)

debug3: channel 0: close_fds r -1 w -1 e 6
debug1: fd 0 clearing O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
Transferred: sent 2296, received 2144 bytes, in 2.5 seconds
Bytes per second: sent 904.0, received 844.2
debug1: Exit status 1
Connection closed


Last edited by Hangman2; 08-22-2011 at 06:05 PM..
# 10  
Old 08-22-2011
This User Gave Thanks to binlib For This Post:
# 11  
Old 08-23-2011
Possible problem found

Hi All,
Thanks to everyone who contributed.

I tried to do an SSH and found that it is prompting that password has expired and needs to be changed again.

I changed password of that user but on SSH it again prompts to change password, so it appears that something is wrong with the profie of that user and needs to be looked at by our UNIX Admins.

Does anyone know what property can be looked at for this??

Smilie
# 12  
Old 10-17-2011
Problem may be with sshd_config

I had a similar, if not the same issue: I could ssh into a server, but sftp would fail with "Connection closed". To cut a dull story short, I remembered that the sshd_config file I use in my Linux luggable is copied and adapted from my MBP. Could the problem lie within? Why yes. Yes it could.

Check the Subsystem line in the sshd_config file. Because it was copied from the Mac, this read:
Subsystem
Code:
sftp /usr/local/libexec/sftp-server

Needless to say, this location did not exist on the Lintop. To find the correct file/location, type:
Code:
find /usr -name "sftp-server" -print(or / instead of /usr)

, then copy the result and paste after ]Subsystem sftp.

Restart sshd and hopefully, all will be well...
# 13  
Old 10-17-2011
for SSH or SFTP should not prompt for the password you should generate the public keys as below

On source host:
Code:
 cd ~
    mkdir .ssh
    chmod 700 .ssh
    cd .ssh
    /usr/local/bin/ssh-keygen -t rsa -b 1024(or ssh-keygen -t rsa -b 1024)
    cat id_rsa.pub
    copy contents of id_rsa.pub

On destination host:
Code:
 cd ~ 
    mkdir .ssh
    chmod 700 .ssh
    cd .ssh
    vi authorized_keys
    paste contents of id_rsa.pub from Connecting source server into authorized keys(to which ever it connects to get data)
    :wq!
    chmod 600 authorized_keys(don't miss this permission, this should be and must be 600)

hope it helps
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Server closed the connection unexpectedly

Hi, I have a bash script which connects HP Vertica DB and executes few sql files in sequential manner. One sql file has commands related to one table(stage , base schema tables)and contains 7-8 commands such as creating temp table, inserting data into tables etc. For few tables, which have high... (7 Replies)
Discussion started by: Dharmatheja
7 Replies

2. UNIX for Dummies Questions & Answers

Exit Status 255, Connection closed in SFTP

I'm trying to connect from Server A to Server B to transfer files from A to B. I'm using NUID A1 in Server A and NUID A2 in Server B. I have done the following the steps to setup password-less login. 1. Add the public key of A1 in A to the Authorized keys of A2 in B. 2. Add the public key of... (4 Replies)
Discussion started by: sanchid312
4 Replies

3. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

4. AIX

ssh connection closed by ip

Hi i am trying to do ssh without password between 2 aix servers. before i generate the keys, i am able to do the ssh & it is asking for password & i am able to login. ======================== # ssh 172.29.150.77 root@172.29.150.77's password: ======================== but when i generate rsa... (1 Reply)
Discussion started by: makarand.bhatka
1 Replies

5. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

6. UNIX for Advanced & Expert Users

Tomcat Connection closed

Hi how can do why a process closed a connection? # lsof -i tcp:8080 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME java 5851 tomcat 29u IPv6 73216185 TCP *:webcache (LISTEN) # telnet localhost 8080 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1).... (0 Replies)
Discussion started by: lain
0 Replies

7. HP-UX

ftp first connection closed

Hi, Have anyone seen this problem, there is one remote side where their ftp connection to our server will always fail with connection closed by remote host and the second connection will be working. is this an OS issue or network issue? Thanks Robert (4 Replies)
Discussion started by: robertngo
4 Replies

8. UNIX for Dummies Questions & Answers

ssh_exchange_identification: Connection closed by remote host Connection closed

Hi Everyone, Good day. Scenario: 2 unix servers -- A (SunOS) and B (AIX) I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time. Some of these sftp's fail with the following error: ssh_exchange_identification: Connection... (1 Reply)
Discussion started by: jeevan_fimare
1 Replies

9. UNIX for Advanced & Expert Users

SFTP Connection Closed

Hey when trying to connect to a server using a key I get sftp -o 'Port=22' -o'IdentityFile=/home/datatel/.ssh/id_dsa_xei' becker_xei@host Connecting to host... ANGEL SFTP ServerConnection closed by host Connection closed Any ideas? (1 Reply)
Discussion started by: ed.browne
1 Replies

10. UNIX for Dummies Questions & Answers

no shell connection closed error

Hi, I have created some users on my new enviroment on sun solaris in the aptempt to create a .profile which I did. I must have done something wrong because when I try to connect to one of this users it says:no shell, connection closed. The only thing I can think is that in my .profile I inserted... (2 Replies)
Discussion started by: giulianob
2 Replies
Login or Register to Ask a Question