少于 1 分钟阅读

SSH To Server Without Password

local client public key to server keys, next login will not use password

cat ~/.ssh/id_rsa.pub | ssh root@192.168.3.105 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Add Alias To Client

vim ~/.ssh/config

( Set alias to ubuntu_server user to root port to 22 )

Add lines:

Host ubuntu_server
     HostName 192.168.1.112
     User root
     Port 22

Then next you can access ssh server:

ssh ubuntu_server

更新时间:

留下评论