ssh-agent
or gnome-keyring
allows you to enter that passphrase periodically, instead of each time you use the key to access a remote system.ssh-keygen
command, and choosing the defaults at all the prompts:~/.ssh
directory, which will be created if it does not exist:.pub
is the public key that needs to be transferred to the remote systems. It is a file containing a single line: The protocol, the key, and an email used as an identifier. Options for the ssh-keygen
command allow you to specify a different identifier:ssh-keygen
command also displays the fingerprint and randomart image that are unique to this key. This information can be shared with other people who may need to verify your public key.-l
option lists the fingerprint, and the -v
option adds the ASCII art.ssh-copy-id
command. If you used the default name for the key all you need to specify is the remote user and host:sshd
man page.ssh-keygen
command with the -p
option:-f
), and the old (-P
) or new (-N
) passphrases on the command line. Remember that any passwords specified on the command line will be saved in your shell history.ssh-keygen
man page for additional options.ssh-keygen
, and the new public key has to be transferred to the desired remote systems.kdump
utility, when configured to dump the kernel to a remote system using SSH, is one example.ssh-agent
daemon and an ssh-add
utility to cache the unlocked private key. The GNOME desktop also has a keyring daemon that stores passwords and secrets but also implements an SSH agent.openssh_keypair
module uses ssh-keygen
to generate keys and the authorized_key
module adds and removes SSH authorized keys for particular user accounts.ssh-keygen
command to generate SSH public and private key files. By default, these files are created in the ~/.ssh directory. You can specify a different location, and an optional password (passphrase) to access the private key file. If an SSH key pair with the same name exists in the given location, those files are overwritten.--generate-ssh-keys
option. The key files are stored in the ~/.ssh directory unless specified otherwise with the --ssh-dest-key-path
option. If an ssh key pair already exists and the --generate-ssh-keys
option is used, a new key pair will not be generated but instead the existing key pair will be used. In the following command, replace VMname and RGname with your own values:cat
command, replacing ~/.ssh/id_rsa.pub
with the path and filename of your own public key file if needed:pbcopy
. Similarly in Linux, you can pipe the public key file to programs such as xclip
.--ssh-key-values
option. In the following command, replace myVM, myResourceGroup, UbuntuLTS, azureuser, and mysshkey.pub with your own values:--ssh-key-values sshkey-desktop.pub sshkey-laptop.pub
.