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
To access your sftp from other hosts, please make sure following is installed and configured properly.
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>