Search code examples
sshwinscp

WinScp: Connection has been unexpectedly closed. server sent command exit status 127


My Server is Ubuntu 14.04.5 LTS and I am able to connect SSH in Putty, but not able to connect via WinSCP.

When I try to connect via WinSCP it gives below error:

Connection has been unexpectedly closed. server sent command exit status 127

enter image description here


Solution

  • To access your sftp from other hosts, please make sure following is installed and configured properly.

    • Installed OpenSSH servers
    • Configured sshd_config
      • PubkeyAuthentication yes
      • Subsystem sftp internal-sftp
    • Added your public key to ~/.ssh/authorized_keys

    • Start the ssh server with port 22/TCP open # /etc/init.d/sshd start

    • # iptables -I INPUT -j ACCEPT -p tcp --dport 22

    Finally, test $ sftp <login>@<hostname>