The ubuntu16.04 server is configured with ssh passage free login
- 2020-05-13 04:13:56
- OfStack
Operate on the client side
ssh-keygen -t rsa
File location to write/home try /. ssh/server_rsa, I named server_rsa about it, do not use the default values affect git key (because I git is using a default value)
ssh-copy-id root@123.45.56.78 (your server ip),
Or the use
cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
You can upload your client key to the server's ~/.ssh /authorized_keys file, or manually copy it in.
Operate on the server side
sudo nano /etc/ssh/sshd_config
Change this to without-password to achieve root free login
Namely PermitRootLogin without - password
ssh shorthand tips
vim ~/.ssh/config
add
Host lisa, easy to remember
HostName 188.166.225.189 your server ip
User root
Port 9999 (port optional, not recommended) (I didn't use the last two, but the first three are enough)
IdentityFile ~/.ssh /id_rsa certified key location, if it has already been sent to the server, do not use this
ssh lisa can be used instead of ssh root@188.166.225.186