SSH Keys server as a means of identifying yourself to a Secure Shell (SSH) server using public-key cryptography and challenge-response authentication.
NOTE if the file authorized_keys did not exist and you had to create it you must make sure it has the right file permissions in this case 600 (eg -rw------- ).
$ ssh-keygen -t <type>
ssh-keygen -t rsa
Enter the file in which to save the key (/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
ssh-keygen -t rsa
Generating public/private rsa key pair. Enter file in which to save thr key (/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /user/.ssh/id_rsa. Your public key has been saved in /user/.ssh/id_rsa.pub. The key fingerprint is: e7:38:47:65:25:71:ff:1c:ee:e4:a8:37:31:0d:58:80 user@server The keys randomart image is: +--[ RSA 2048]----+ | ..+.o | | E = . | | = ..| | + ...o| | S o ooo| | = o=. | | o o .oo | | o .o | | .. . | +-----------------+
ssh-copy-id user@machine
NOTE if the file authorized_keys does not exist you will have to create it.
mymac:~ user$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/Users/user/.ssh/id_rsa): Creating directory '/Users/user/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/user/.ssh/id_rsa. Your public key has been saved in /Users/user/.ssh/id_rsa.pub. The key finderprint is: e7:38:47:65:25:71:ff:1c:ee:e4:a8:37:31:0d:58:80 user@mymac The key's randomart image is: +--[ RSA 2048]----+ | ..+.o | | E = . | | = ..| | + ...o| | S o ooo| | = o=. | | o o .oo | | o .o | | .. . | +-----------------+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDbssnZ8NweOd3i00gZX+iRY8s2bOYh7j+zc00ln/t6OLE66HVxo7OcYKoF0mN1W4hFXktlWaMs3JOBdTMF1tGySm1W8O+pXvporA/rb+2SBnpvD2kAa7AnuNzEBoJ89SGD2NC0rwXick9pOLTSKLy8rVBkEW6jZ4qut0kisIVtq/2jGEMSDmiGd1dPF2AmVJIpLYz2R5gFGMLW6TANXtH5+3VNtCu6ZfI0vFFNW1RfY7O8xWeov4Lu4qxAGI/59gvMUvtUVOycvxQilXjh9s7A1zohv+vYrjga8I2YUKK5JScMrL7ltZ1c31n3rsn5cQqcUhrpahqDS0KUe+rO3LzXiPX4LasIiaO7wnR9e3bm8T9eHCOQplhVqYWB5nW9pQIhu2wdZWVZSwjk9pMK3l0hGIHPVEqMUxnaNXXaYFIFAajnM/hw+/dzmlRNL9IUOGOZ1OvyZiuKhT2XI/5DJl3eReeD1lIjdF0aO0GFJXsq5tk0VjJqkiMEYiB3Th9qSqzP6lUq7Q48J7l6DVpPloNHXq7Fth9ofFU/p0iW0Ax5PIQCfkS7tBgW5gecJ5sR2F3QdXdC+DDbvJUXa3KO1CwepNYGm0nKmztiY7oEQ8nrB1MQsw6uEgj1MGzVkYKeRoEPAH2c1MJq+LjmUhxh0x0pRFeQYiccKl2v/AI0CA40Dw== user@mymac
NOTE if the file authorized_keys did not exist and you had to create it you must make sure it has the right file permissions in this case 600 (eg -rw------- ).