0

I am sure I was SCPing some files TO the server before, but now it does not work in opposite direction.

I'm using:

$ scp -v mysrv:/home/XXX/dir/app.rb app.rb.bak

Authenticated to mysrv ([88.88.111.11]:22) using "publickey". debug1: channel 0: new session [client-session] (inactive timeout: 0) debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: pledge: filesystem debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 ... debug1: Sending subsystem: sftp debug1: pledge: fork subsystem request failed on channel 0 scp: Connection closed

A.D.
  • 563

1 Answers1

1

Found out in logs on the server that SFTP subsystem can not be found.

# journalctl -f
Jan 24 16:45:43 mysrv sshd[2045]: subsystem request for sftp by user XXX failed, subsystem not found

Don't know how it was disabled, but re-enabling it in config solved the issue. Just uncomment one line..

# nano /etc/ssh/sshd_config 
Subsystem       sftp    /usr/lib/openssh/sftp-server

Don't forget to restart the SSHd.

# systemctl restart ssh

Just for search engine bots - here is the successfull SCP log:

Authenticated to mysrv ([88.88.111.11]:22) using "publickey".
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
...
debug1: Sending subsystem: sftp
debug1: pledge: fork
scp: debug1: Fetching /home/XXX/dir/app.rb to app.rb.bak

app.rb 100% 38KB 297.3KB/s 00:00
scp: debug1: truncating at 39240 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 3248, received 42336 bytes, in 1.3 seconds Bytes per second: sent 2528.5, received 32958.1 debug1: Exit status 0

A.D.
  • 563