I can ssh to my EC2 instance (amazon linux) (same user, from same machine, same certificate) however I can no longer use sftp.
Logging in via WinScp (via my windows7 box) for SFTP used to work, but now it gives me "exit code 128, is sftp running" , the error log just shows me 'subsystem request for sftp'
How can I get it to work?
debugging delivers this:
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request simple@putty.projects.tartarus.org reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req simple@putty.projects.tartarus.org
debug1: server_input_channel_req: channel 0 request auth-agent-req@openssh.com reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req auth-agent-req@openssh.com
debug1: temporarily_use_uid: 222/500 (e=222/500)
debug1: restore_uid: (unprivileged)
debug2: fd 8 setting O_NONBLOCK
debug1: channel 1: new [auth socket]
debug1: server_input_channel_req: channel 0 request subsystem reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req subsystem
subsystem request for sftp
debug1: subsystem: exec() /usr/libexec/openssh/sftp-server
debug2: fd 5 setting TCP_NODELAY
debug2: fd 11 setting O_NONBLOCK
debug2: fd 10 setting O_NONBLOCK
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 10940
debug1: session_exit_message: session 0 channel 0 pid 10940
debug2: channel 0: request exit-signal confirm 0
debug1: session_exit_message: release channel 0
debug2: channel 0: write failed
debug2: channel 0: close_write
debug2: channel 0: send eow
debug2: channel 0: output open -> closed
debug2: channel 0: read<=0 rfd 11 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed
debug2: channel 0: send close
debug2: notify_done: reading
debug2: channel 0: rcvd close
debug2: channel 0: is dead
debug2: channel 0: gc: notify user
debug1: session_by_channel: session 0 channel 0
debug1: session_close_by_channel: channel 0 child 0
debug1: session_close: session 0 pid 0
debug2: channel 0: gc: user detached
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: server-session, nchannels 2
Connection closed by 1.2.3.4
debug1: channel 1: free: auth socket, nchannels 1
debug1: do_cleanup
debug1: temporarily_use_uid: 222/500 (e=222/500)
debug1: restore_uid: (unprivileged)
Transferred: sent 2472, received 2224 bytes
Closing connection to 1.2.3.4 port 42647
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials
update: problem was I edited my .bashrc which outputted something to stdout. Since sftp starts up a new shell for the user and does not like that.... it fails with a exit code 128.