$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/joe/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/joe/.ssh/id_rsa. Your public key has been saved in /home/joe/.ssh/id_rsa.pub. The key fingerprint is: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 joe@mycomputer The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | | | | | | | | | | | | +-----------------+Copy your public key to host server:
$ scp ~/.ssh/id_rsa.pub joe@example.com:~/.ssh/joe@mycomputer.pubThen, log into your host server and create/append the public key to a file named, authorized_keys:
$ cat ~/.ssh/joe@mycomputer.pub >> ~/.ssh/authorized_keys $ chmod go-w ~/. ~/.ssh/authorized_keys $ chmod go-rwx ~/.sshhttp://www.openssh.org/faq.html#3.14
NOW, logout and log back in. You won't be asked for the password again!
No comments:
Post a Comment