-
install ssh server
sudo apt-get install openssh-server
-
generate a key pair
ssh-keygen -t rsaif your have entered file in which to save the key, for example,
flirthen two file namedflirandflir.pubwill be generated at the current folder, represent private key and public key respectively. If not, rsa and rsa.pub is the name by default, and they can be found at the folder~/.ssh/ -
the private key and public key should be palced at
$HOME/.ssh/mv flir ~/.ssh/ mv flir.pub ~/.ssh/ -
uplode the public key
flir.pubto the serverssh-copy-id -i ~/.ssh/flir.pub <username>@<ipaddress> -
now try logging into the server with
ssh <username>@<ipaddress>
- The client generate a private key and public key pair
- The private key should be placed at the folder
~/.ssh/of client - The content of public key should be concatenated at the file
~/.ssh/authorized_keysof server - The
~/.sshfolder should be in modedrwx------(700) in order to forbidden to other users - Once configured the ssh login with key, it's better to refuse access by password at the server side by setting
PasswordAuthentication noin/etc/ssh/sshd_configof the server
Reference