SFTP connection is getting closed after password

0

We have set up Cygwin on Windows 2012 and the services related to the tool are running fine on the server.

During installation we have created a local user cyg_server, we tried to create home folder with cyg_server using sftp cyg_server@servername but in this case when we try to do sftp -v cyg_server@servername it is prompting for the password which we have entered and the connection established home it immediately getting closed with the below result.

details

ssh -v cyg_server@fn002dataaege-n.fn.ae.ge.com
OpenSSH_4.2p1, OpenSSL 0.9.7i 14 Oct 2005
debug1: Reading configuration data /opt/LTIssh/etc/ssh_config
debug1: Connecting to fn002dataaege-n.fn.ae.ge.com [3.14.136.107] port 22.
debug1: Connection established.
debug1: identity file /export/home/chettigo/.ssh/identity type -1
debug1: identity file /export/home/chettigo/.ssh/id_rsa type 1
debug1: identity file /export/home/chettigo/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1
debug1: match: OpenSSH_5.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.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 'fn002dataaege-n.fn.ae.ge.com' is known and matches the RSA host key.
debug1: Found key in /export/home/chettigo/.ssh/known_hosts:2035
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: /export/home/chettigo/.ssh/identity
debug1: Offering public key: /export/home/chettigo/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /export/home/chettigo/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
cyg_server@fn002dataaege-n.fn.ae.ge.com's password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Last login: Thu Feb 26 06:23:07 2015 from gpsgc304.corporate.ge.com
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
debug1: channel 0: free: client-session, nchannels 1
Connection to fn002dataaege-n.fn.ae.ge.com closed.
debug1: Transferred: stdin 0, stdout 0, stderr 52 bytes in 17.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 3.0
debug1: Exit status 1

How can I debug and resolve this issue?

vikas

Posted 2015-02-26T12:45:42.943

Reputation: 1

can you connect using WinSCP? it may provide more meaningful logs. From what I'm seeing in your logs, the failure is there, but no information as to the cause, which looks like it dumped to stdErr. you can try redirecting stderr to a file, with: ssh -v cyg_server@fn002dataaege-n.fn.ae.ge.com 2> error.log. after it fails look at ~/error.log and see if there is more meaningful debug info on the failure. – Frank Thomas – 2015-02-26T13:02:18.853

in the event logs i could see the event id as 0 and the description as below – vikas – 2015-02-26T13:08:49.050

The description for Event ID 0 from source sshd cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

sshd: PID 4376: syslogin_perform_logout: logout() returned an error – vikas – 2015-02-26T13:09:16.563

I'd try testing your configuration using PuTTY or WinSCP, to confirm that the server is working correctly. – Frank Thomas – 2015-02-26T14:01:56.573

tried with different client putty as well as secure shell i get the same result, am able to give the password but it gets immediate disconnect – vikas – 2015-02-26T16:08:06.967

could anyone please help here ? – vikas – 2015-02-27T11:02:02.817

did you run the command in my first comment, and then check the log of STDErr? Not the event log. – Frank Thomas – 2015-02-27T13:56:14.710

i have run the command ssh -v cyg_server@fn002dataaege-n.fn.ae.ge.com on cygwin bash below are the results that it displayed – vikas – 2015-02-27T15:25:19.340

The description for Event ID 0 from source sshd cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: sshd: PID 4660: syslogin_perform_logout: logout() returned an error – vikas – 2015-02-27T15:26:18.727

Answers

0

In your account shell initialization scripts, I have found that if there is ANY output being sent to stdout then scp/sftp fails in the way you describe.

What you have to do is check all files on the remote host including:

  • account specific .cshrc, .login, .bashrc, .env, .profile
  • global initialization files in /etc such as bashrc, csh.cshrc, csh.login

mdpc

Posted 2015-02-26T12:45:42.943

Reputation: 4 176