Creating a private/public key pair on Ubuntu Last updated: 04 Jun 2012. There are many reasons you might want to create a key pair on Linux, more specifically on Ubuntu. For more information about key pairs, see this. If your server is an Amazon EC2 Server Instance, you might want to look at more specific information here.
How do I generate ssh RSA keys under Linux operating systems?
You need to use the ssh-keygen command as follows to generate RSA keys (open terminal and type the following command):ssh-keygen -t rsa
ORssh-keygen
Sample outputs:
The -t type option specifies the type of key to create. The possible values “rsa†or “dsa†for protocol version 2. The $HOME/.ssh stores the following two files:
Please do not share keys file with anyone else. You can upload keys to remote server as follows:ssh-copy-id [email protected]
Finally, you can login to remote server as follows:ssh [email protected]
scp file.txt [email protected]:~/data2/
ADVERTISEMENTS