When trying to connect to an ssh server with WinSCP one possible explanation for the message «error listing directory» is that port 21 (ftp) is used instead of port 22 (ssh). So, in case there’s no ftp server, there will also be no answer.
Suppose you are logged in machine A and you need passwordless access to an account on machine B.
(1) Create RSA keys:
ssh-keygen -t rsa -f B_key
This will create two files:
B_key.pub. The first is the private key and the second is the public key of the RSA protocol.
(2) Copy the contents of
B_key.pub into the file
authorized_keys in the
.ssh directory of the remote account:
cat B_key.pub | ssh B_user@B_machine 'cat >> .ssh/authorized_keys'
(3) Login to machine B:
ssh -i B_key B_user@B_machine