WinSCP – Set up Public and Private Key Authentication to transfer files between Client and Server:
Server Side (Linux):
-- Generate SSH public & private keys.
-- Be sure to enter passphrase twice
[test@Server_A .ssh]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id_rsa.
Your public key has been saved in /home/test/.ssh/id_rsa.pub.
The key fingerprint is:
89:3e:65:7a:dc:29:c9:a1:b7:bd:85:db:7f:0f:57:dc test@Server_A
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| . . ..|
| . S E|
| . B + o .|
| = B + . . .|
| + + + o.|
| . +.....o|
+-----------------+
[test@Server_A .ssh]$ cat id_rsa.pub >> ~/.ssh/authorized_keys
[test@Server_A .ssh]$ chmod 600 authorized_keys
[test@Server_A .ssh]$ rm id_rsa.pub
# Upload the private key file : id_rsa to the Windows Client Machine
Use Putty Key Generator to Load the private key file:
Use Pageant program to keep the passphrase in memory and avoid entering passphrase each time.
Add the private key file to the Key list as follows:
Now you can login the server without entering any password and passphrase.
