Jan 22, 2016 Using PSCP - Putty SCP (Secure Copy) to transfer files securely PSCP, the PuTTY Secure Copy client, is a tool for transferring files securely between computers using an SSH connection.
SSH can handle authentication using a traditional username and password combination or by using a public and private key pair. The SSH key pair establishes trust between the client and server, thereby removing the need for a password during authentication. While not required, the SSH private key can be encrypted with a passphrase for added security.
The PuTTY SSH client for Microsoft Windows does not share the same key format as the OpenSSH client. Therefore, it is necessary to create a new SSH public and private key using the PuTTYgen tool or convert an existing OpenSSH private key.
Both PuTTY and PuTTYgen are required to convert OpenSSH keys and to connect to the server over SSH. These two tools can be downloaded individually or, preferably, as a Windows installer from the PuTTY Download Page.
Once the PuTTY Windows installer is downloaded, double-click the executable in the Download folder and follow the installation wizard. The default settings are suitable for most installations. Both PuTTY and PuTTYgen should now be accessible from the Windows Programs list.
If you have an existing OpenSSH public and private key, copy the id_rsa
key to your Windows desktop. This can be done by copying and pasting the contents of the file or using an SCP client such as PSCP which is supplied with the PuTTY install or FileZilla.
Next launch PuTTYgen from the Windows Programs list.
Conversions
from the PuTTY Key Generator menu and select Import key
.Open
.Actions
/ Save the generated key
, select Save private key
.id_rsa.ppk
.If the public key is already appended to the authorized_keys
file on the remote SSH server, then proceed to Connect to Server with Private Key.
Otherwise, proceed to Copy Public Key to Server.
Launch PuTTYgen from the Windows Programs list and proceed with the following steps.
Parameters
, increase the Number of bits in a generated key:
to a minimum value of 2048.Actions
/ Generate a public/private key pair
, click Generate
.Save private key
under Actions
/ Save the generated key
.id_rsa.ppk
.Key
/ Public key for pasting into OpenSSH authorized_keys file:
contains the public key.The OpenSSH public key is located in the box under Key
/ Public key for pasting info OpenSSH authorized_keys file:
. The public key begins with ssh-rsa followed by a string of characters.
Use your preferred text editor to create and/or open the authorized_keys
file:
Paste the public key into the authorized_keys
file.
Save the file and close the text editor.
Adjust the permissions of the authorized_keys
file so that the file does not allow group writable permissions.
Logout of the remote server.
Now it is time to test SSH key authentication. The PuTTYgen tool can be closed and PuTTY launched again.
Session
.Connection
> SSH
> Auth
.Browse...
under Authentication parameters
/ Private key file for authentication
.id_rsa.ppk
private key and click Open
.Open
again to log into the remote server with key pair authentication.SSH can handle authentication using a traditional username and password combination or by using a public and private key pair. The SSH key pair establishes trust between the client and server, thereby removing the need for a password during authentication. While not required, the SSH private key can be encrypted with a passphrase for added security.
The PuTTY SSH client for Microsoft Windows does not share the same key format as the OpenSSH client. Therefore, it is necessary to create a new SSH public and private key using the PuTTYgen tool or convert an existing OpenSSH private key.
Both PuTTY and PuTTYgen are required to convert OpenSSH keys and to connect to the server over SSH. These two tools can be downloaded individually or, preferably, as a Windows installer from the PuTTY Download Page.
Once the PuTTY Windows installer is downloaded, double-click the executable in the Download folder and follow the installation wizard. The default settings are suitable for most installations. Both PuTTY and PuTTYgen should now be accessible from the Windows Programs list.
If you have an existing OpenSSH public and private key, copy the id_rsa
key to your Windows desktop. This can be done by copying and pasting the contents of the file or using an SCP client such as PSCP which is supplied with the PuTTY install or FileZilla.
Next launch PuTTYgen from the Windows Programs list.
Conversions
from the PuTTY Key Generator menu and select Import key
.Open
.Actions
/ Save the generated key
, select Save private key
.id_rsa.ppk
.If the public key is already appended to the authorized_keys
file on the remote SSH server, then proceed to Connect to Server with Private Key.
Otherwise, proceed to Copy Public Key to Server.
Launch PuTTYgen from the Windows Programs list and proceed with the following steps.
Parameters
, increase the Number of bits in a generated key:
to a minimum value of 2048.Actions
/ Generate a public/private key pair
, click Generate
.Save private key
under Actions
/ Save the generated key
.id_rsa.ppk
.Key
/ Public key for pasting into OpenSSH authorized_keys file:
contains the public key.The OpenSSH public key is located in the box under Key
/ Public key for pasting info OpenSSH authorized_keys file:
. The public key begins with ssh-rsa followed by a string of characters.
Use your preferred text editor to create and/or open the authorized_keys
file:
Paste the public key into the authorized_keys
file.
Save the file and close the text editor.
Adjust the permissions of the authorized_keys
file so that the file does not allow group writable permissions.
Logout of the remote server.
Now it is time to test SSH key authentication. The PuTTYgen tool can be closed and PuTTY launched again.
Session
.Connection
> SSH
> Auth
.Browse...
under Authentication parameters
/ Private key file for authentication
.id_rsa.ppk
private key and click Open
.Open
again to log into the remote server with key pair authentication.