

Note: By default, ssh-copy-id will copy the most recent $HOME/.ssh/id*.pub file to the remote box, and add it to the $HOME/.ssh/authorized_keys file there. Assuming you have reason to trust that remotebox is the machine you think it is, it is safe to say yes here. This is because the two machines share the machine-level SSH public keys, so that you can tell, on subsequent connections, that it is the same machine that you connected to before (not a substitute, aka "man-in-the-middle", trying to steal your authentication tokens). If this is the first time that you have connected to remotebox, SSH will also say that " The authenticity of host 'remotebox (192.168.1.92)' can't be established".
SSH COPY KEY PASSWORD
You will have to enter the password to log in to the remote box, of course, because you do not (yet!) have SSH key-based login enabled. Your public key has been saved in /home/steve/.ssh/id_rsa.pub.Ģa:fa:91:3a:a9:5d:b0:14:df:0a:e0:2e:5e:7f:b5:b8 key's randomart image is: Your identification has been saved in /home/steve/.ssh/id_rsa. Here, you could press ENTER to create a key with no passphrase, though in this example, we use a passphrase of ssh-keygenĮnter file in which to save the key (/home/steve/.ssh/id_rsa): press ENTERĮnter passphrase (empty for no passphrase): sshkey-passphraseĮnter same passphrase again: sshkey-passphrase

You can give it a different prefix if you like, when it prompts you below. I cannot think of a situation in which I would create a key without a passphrase if there is no passphrase, then as soon as somebody gets that file, they can impersonate you.īy default, it will create the Private key in $HOME/.ssh/id_rsa and the Public key in $HOME/.ssh/id_rsa.pub. This means that even if someone gets hold of your private key file (such as, a system where somebody else has root access, or if you need to be certain that the key won't be usable by anybody else if they get hold of it at some time in the future), it won't do them any good, because they will need the passphrase to unlock the key itself. You may optionally add a passphrase to the key. The ssh-keygen command does this for you. If you don't already have a id_rsa and id_rsa.pub in your $HOME/.ssh/ directory, then you will need to create them. It also configures all of the file permissions correctly, because SSH is (rightly) very picky about who can access your SSH configuration. The ssh-copy-id command copies your Public Key to a remote machine. Handy ssh command of the day: ssh-copy-id. 8th October 2016 Copying SSH ~/.ssh/id_rsa between machines
