Operating System - HP-UX
1748069 Members
5512 Online
108758 Solutions
New Discussion

Re: Request for subsystem 'sftp' failed on channel 0

 
SOLVED
Go to solution
laiju.c.babu
Regular Advisor

Request for subsystem 'sftp' failed on channel 0

Hi Team,

 

When i am trying to sftp to a Windows server i am getting this server . This was working  till yesterday. I didnt made any changes in Unix machine. Please see below for error

 

*****PSPR*/u09/ps/pspro > sftp tusl01p@****

Connecting to *******...
Request for subsystem 'sftp' failed on channel 0
Connection closed

 

Pease find below with -v option

======================

 

******PSPR*/u09/ps/pspro > sftp -v tusl01p@******

Connecting to *******...
OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17, OpenSSL 0.9.7m 23 Feb 2007
HP-UX Secure Shell-A.04.70.010, HP-UX Secure Shell version
debug1: Reading configuration data /u09/ps/pspro/.ssh/config
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to ussecvmpalisap1 [199.52.50.79] port 22.
debug1: Connection established.
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_1 type 2
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_2 type 2
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_3 type 2
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_4 type 2
debug1: Remote protocol version 2.0, remote software version WRQReflectionforSecureIT_7.2 Build 151
debug1: no match: WRQReflectionforSecureIT_7.2 Build 151
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17
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 'ussecvmpalisap1' is known and matches the RSA host key.
debug1: Found key in /u09/ps/pspro/.ssh/known_hosts:76
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
debug1: Next authentication method: publickey
debug1: Offering public key: /u09/ps/pspro/.ssh/id_dsa_1
debug1: Authentications that can continue: publickey
debug1: Offering public key: /u09/ps/pspro/.ssh/id_dsa_2
debug1: Server accepts key: pkalg ssh-dss blen 434
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug1: Final hpn_buffer_size = 131072
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending subsystem: sftp
Request for subsystem 'sftp' failed on channel 0
Connection closed

 

In the sshd_config  below entries are already  existing

 

     [37]> grep sftp sshd_config
Subsystem               sftp    /opt/ssh/libexec/sftp-server
hpux69d2:[opsroot]/opt/ssh/etc
     [38]> ls -l /opt/ssh/libexec/sftp-server
-rwxr-xr-x   1 root       root        106496 Nov 19  2007 /opt/ssh/libexec/sftp-server

 

Could you please help me on this

 

Regards

 

Laiju.C.Babu
6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: Request for subsystem 'sftp' failed on channel 0

>Please find below with -v option

 

Please provide the -vvv option instead.

Also, what is being logged on the Windows side?

laiju.c.babu
Regular Advisor

Re: Request for subsystem 'sftp' failed on channel 0

Hi Dennis,

 

Please find the output of -vvv

 

*******PSPR*/u09/ps/pspro >sftp -vvv tusl01p@*******

Connecting to ussecvmpalisap1...
OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17, OpenSSL 0.9.7m 23 Feb 2007
HP-UX Secure Shell-A.04.70.010, HP-UX Secure Shell version
debug1: Reading configuration data /u09/ps/pspro/.ssh/config
debug3: cipher ok: aes128-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: 3des-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: blowfish-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: cast128-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: arcfour [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: aes192-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: cipher ok: aes256-cbc [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug3: ciphers ok: [aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc]
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to ussecvmpalisap1 [199.52.50.79] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /u09/ps/pspro/.ssh/id_dsa_1.
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_1 type 2
debug3: Not a RSA1 key file /u09/ps/pspro/.ssh/id_dsa_2.
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_2 type 2
debug3: Not a RSA1 key file /u09/ps/pspro/.ssh/id_dsa_3.
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_3 type 2
debug3: Not a RSA1 key file /u09/ps/pspro/.ssh/id_dsa_4.
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /u09/ps/pspro/.ssh/id_dsa_4 type 2
debug1: Remote protocol version 2.0, remote software version WRQReflectionforSecureIT_7.2 Build 151
debug1: no match: WRQReflectionforSecureIT_7.2 Build 151
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17
debug2: fd 4 setting O_NONBLOCK
debug3: RNG is ready, skipping seeding
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,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
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: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour256,arcfour128,arcfour
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour256,arcfour128,arcfour
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-ripemd160,hmac-sha256,hmac-sha512
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-ripemd160,hmac-sha256,hmac-sha512
debug2: kex_parse_kexinit: zlib,none
debug2: kex_parse_kexinit: zlib,none
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-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 129/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: filename /u09/ps/pspro/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 76
debug3: check_host_in_hostfile: filename /u09/ps/pspro/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 77
debug1: Host 'ussecvmpalisap1' is known and matches the RSA host key.
debug1: Found key in /u09/ps/pspro/.ssh/known_hosts:76
debug2: bits set: 481/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: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /u09/ps/pspro/.ssh/id_dsa_1 (40030ef8)
debug2: key: /u09/ps/pspro/.ssh/id_dsa_2 (40030f78)
debug2: key: /u09/ps/pspro/.ssh/id_dsa_3 (40032338)
debug2: key: /u09/ps/pspro/.ssh/id_dsa_4 (40032358)
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
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: /u09/ps/pspro/.ssh/id_dsa_1
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Offering public key: /u09/ps/pspro/.ssh/id_dsa_2
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 434
debug2: input_userauth_pk_ok: fp b9:fb:4f:35:24:4b:4d:d2:82:69:ba:f3:aa:64:e3:58
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug2: fd 5 setting O_NONBLOCK
debug2: fd 6 setting O_NONBLOCK
debug1: Final hpn_buffer_size = 131072
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
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 4 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 16384 rmax 35000
debug2: tcpwinsz: 32768 for connection: 4
Request for subsystem 'sftp' failed on channel 0
Connection closed

 

Regards

 

Laiju.C.Babu
Matti_Kurkela
Honored Contributor

Re: Request for subsystem 'sftp' failed on channel 0

> Request for subsystem 'sftp' failed on channel 0

 

This is the important part in this case. Your sftp client is requesting the SSH service on the Windows host to start up a sftp subsystem for this connection. The Windows server either rejected the request or failed to start its sftp subsystem.

 

For security reasons, the Windows SSH service will only tell your sftp client that the request failed, not the cause of the failure, so increasing the client-side logging level to -vvv will not provide anything useful.

 

The /opt/ssh/libexec/sftp-server is only for serving incoming SFTP connections to the Unix system: it is not used at all when you initiate an outgoing SFTP connection. Since your Unix server is acting as a SFTP client for this connection, neither the Unix sshd daemon nor its configuration file is involved at all.

 

Contact the Windows administrator and have him/her view the Windows SSH service logs to find out why the SFTP request failed or was rejected.

MK
laiju.c.babu
Regular Advisor

Re: Request for subsystem 'sftp' failed on channel 0

Hi MK,

 

Thanks a lot for the description.

 

I am using a passwordless sftp from the Unix machine to windows machine.  It was working till  day before yesterday.  As per my knowledge, for doing passwordless sftp we required to import a key between the servers .

My doubt is in our scenario  whether i have to create any key in our Unix server and gave to windows team.

 

Regards

 

Laiju.C.Babu
Steven Schweda
Honored Contributor
Solution

Re: Request for subsystem 'sftp' failed on channel 0

 
laiju.c.babu
Regular Advisor

Re: Request for subsystem 'sftp' failed on channel 0

Hi All,

 

Thanks a lot , i have informed same updates to the windows team.  Windows admin had a check on that and now issue is solved.

 

Regards

Laiju.C.Babu