Let’s analyze what happens when invoke the command this way. SHA256:JRcJ3a3eQ4wO/lX4vaCcPckyeayu0ai80EMcdA7m5Dk key's randomart image is: Your public key has been saved in /home/egdoc/.ssh/id_rsa.pub Your identification has been saved in /home/egdoc/.ssh/id_rsa
The easiest way to perform the operation is just to invoke the command without any argument or option: $ ssh-keygenĮnter file in which to save the key (/home/egdoc/.ssh/id_rsa):Įnter passphrase (empty for no passphrase): Generating an SSH keypair is a very simple operation: all we have to do is to use the ssh-keygen utility. The tools and utilities we will use in this tutorial are installed by default in all the major Linux distributions, as part of the OpenSSH software suite. Both clear text passwords and public keys can be allowed as authentication methods at the same time, or, for example, one could decide to allow access only via public keys. The ability to use ssh-keys as login credentials must be allowed server-side by the system administrator, by setting the PubkeyAuthentication option to yes in the /etc/ssh/nfig file.
Ssh copy rsa key how to#
The public key, on the other hand, is used to encrypt data and must be copied on the remote server (its content is copied in the ~/.ssh/authorized_keys file in the $HOME directory of the user we login as on the server – we will see how to perform such operation in the course of this tutorial).
The private key must remain on the local computer which acts as the client: it is used to decrypt information and it must never be shared. They work in pairs: we always have a public and a private key. SSH keys are used as login credentials, often in place of simple clear text passwords. $ – requires given linux-commands to be executed as a regular non-privileged user # – requires given linux-commands to be executed with root privileges either directly as a root user or by use of sudo command
Requirements, Conventions or Software Version Used How to generate and manage ssh keys on Linux Software requirements and conventions used Software Requirements and Linux Command Line Conventions Category