Setup password-less SSH on Ubuntu 16.04
Setup
Published in
1 min readJul 4, 2016
sudo apt-get update
sudo apt-get install openssh-serverssh-keygen -t rsa -P ""
cat ./.ssh/id_rsa.pub >> ./.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys## THEN ##
sudo service ssh start
-- OR --
sudo service ssh restart
-- OR --
sudo reboot
Test SSH login
## ssh from the server host (to itself)
ssh localhost
-- OR --
## ssh from the server or the client host
ssh 10.1.1.1 // 10.1.1.1 is the ip address of the server
Passwordless SSH from the client
Concept: append client’s public key (content of .ssh/id_rsa.pub) TO server’s .ssh/authorized_keys file
### 1. use ssh-copy-id ###
## at CLIENT machine
** ubuntu only, mac does not have ssh-copy-id
** -- format --> ssh-copy-id user@server_IPssh-copy-id luck@10.1.37.12### Then TEST SSH login ###-- OR --### 2. manual append ###
** manually copy the public key content to server's auth file **
** both mac and linux## at CLIENT machine
cd
cat .ssh/id_rsa.pub
>> copy the key (the long text)## at SERVER
cd
vi .ssh/authorized_keys
>> paste the client’s key at the end of the file### Then TEST SSH login ###