SSH Keys

From RHLUG Wiki
Revision as of 04:11, 4 March 2018 by Wesley (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Using keys are more secure than using passwords for SSH, and easier since you don't need to keep entering the password to the remote machine.

Generating a Key

Basically just run the following command and hit enter 3 times to accept the defaults:

ssh-keygen -t rsa

Put Key on a Remote Machine

Run the following line to put the key on the remote machine. Be sure to change the REMOTE_USER and REMOTE_IP with your machine's info:

cat ~/.ssh/id_rsa.pub | ssh REMOTE_USER@REMOTE_IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"