Operating System - HP-UX
1821985 Members
3467 Online
109638 Solutions
New Discussion юеВ

sftp connection works one way!

 
Ahmed_58
Regular Advisor

sftp connection works one way!

Hi,
We are having problem using sftp on HP-UX, sftp works from serverB to serverA but not other way round? I generate a key using this command ssh-keygen -t dsa -N "" and copy it to serverB as authorized_keys but still geting connection closed .... see below
---------------------------------------
batmed1:/home/ahmed>sftp -v ahmed@bat-bbis
Connecting to bat-bbis...
OpenSSH_4.4p1-hpn12v11, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.40.005, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to bat-bbis [10.3.4.11] port 22.
debug1: Connection established.
debug1: identity file /home/ahmed/.ssh/id_rsa type -1
debug1: identity file /home/ahmed/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17
debug1: match: OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.4p1-hpn12v11
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 'bat-bbis' is known and matches the RSA host key.
debug1: Found key in /home/ahmed/.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,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ahmed/.ssh/id_rsa
debug1: Offering public key: /home/ahmed/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentication succeeded (keyboard-interactive).
debug1: Final hpn_buffer_size = 131072
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Connection to bat-bbis closed by remote host.
debug1: Transferred: stdin 0, stdout 0, stderr 47 bytes in 2.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 21.2
debug1: Exit status -1
Connection closed

please help
Ahmed
4 REPLIES 4
David de Beer
Valued Contributor

Re: sftp connection works one way!

Host 'bat-bbis' is known and matches the RSA host key.

check /home/ahmed/.ssh/known_hosts - uncomment the RSA key for 'bat-bbis'

Probably an old key you used.
OFC_EDM
Respected Contributor

Re: sftp connection works one way!

Also if the hosts are different OS's or have different versions of SSH this may cause that behaviour.

Note the different OS isn't the actual issue...it's just that some OS versions only support certain versions of SSH and can't be updated (i.e. Tru64) without going to OpenSSH.
The Devil is in the detail.
Matti_Kurkela
Honored Contributor

Re: sftp connection works one way!

It says "Authentication succeeded" and "Entering interactive session", so the authentication phase has been successfully passed. But after that, something goes wrong and the remote host closes the connection.

You should examine the syslog of serverB (bat-bbis): there might be messages explaining why the ssh server has closed the connection.

One possible cause is that ahmed@bat-bbis is not allowed to run the sftp server process (normally /opt/ssh/libexec/sftp-server) for some reason, or maybe sftp access is disabled in sshd configuration file (/opt/ssh/etc/sshd_config).

MK
MK
Ahmed_58
Regular Advisor

Re: sftp connection works one way!

Dears,
the version shows as;
ServerA
$ ssh -V
OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17, OpenSSL 0.9.7m 23 Feb 2007
HP-UX Secure Shell-A.04.70.021, HP-UX Secure Shell version

ServerB
batmed1:/>ssh -V
OpenSSH_4.4p1-hpn12v11, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.40.005, HP-UX Secure Shell version

IS THIS COULD BE THE CASE?

Ahmed