vscode remote ssh 免密碼步驟
1. 生成公鑰
ssh-genkey 在window 端git-bash中執行,如果沒有安裝git就安裝一個widnow git
- 輸入命令後,提示需要內容,全部不管,回車即可。後面會提示你密碼的:
2. 將公鑰新增到linux server 端
-
方式1 : 直接複製
scp -P 22 id_rsa-remote-ssh.pub [email protected]:~/.ssh/
-
方式2 : 工具命令複製
ssh-copy-id -i .ssh/id_rsa.pub 使用者名稱字@192.168.x.xxx
新增完成 。
`
$ ssh-copy-id -i .ssh/id_rsa.pub [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
`
本文來自部落格園,作者:ljymoonlight,轉載請註明原文連結:https://www.cnblogs.com/ljymoonlight/p/15730136.html