- 本地local免密碼連接配接遠端主機root
- 上傳公鑰到伺服器:root為伺服器上使用者名,IP位址為伺服器IP
-
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
- 設定通過ssh 使用者名連結
-
vi .ssh/config # 配置以下内容 Host ubuntu HostName 10.80.86.170 User ubuntu Port 22
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
vi .ssh/config
# 配置以下内容
Host ubuntu
HostName 10.80.86.170
User ubuntu
Port 22