To generate the pair of keys, on mbp, type
ssh-keygen -t rsaAccept all default answers, and we get two files:
~/.ssh/id_rsa --- the private keyNow, copy the public key file to tsingyi by typing following command on mbp:
~/.ssh/id_rsa.pub --- the public key
scp ~/.ssh/id_rsa.pub wyi@tsingyi:/home/wyi/.ssh/id_rsa-mbp.puband add the public key of mbp to ~/.ssh/authorized_keys of tsingyi by typing following command on tsingyi:
cat ~/.ssh/id_rsa-mbp.pub >> ~/.ssh/authorized_keys
Here we are. We should be able to ssh to tsingyi from mbp without typing password now.
No comments:
Post a Comment