需要:
- vscode + Remote-ssh(vscode插件中下載)
- openssh (https://www.mls-software.com/files/setupssh-8.0p1-2.exe)
win7 中
- C:\Users\upup.ssh\config (出現 Bad owner or permissions on .ssh/config ,win10的解決方案網上可以搜到)
- C:\ProgramData\ssh\config(解決不了就用這個文件)
config文件
Host 名稱
HostName IP
User 用戶名
IdentityFile 私鑰文件目錄
私鑰文件生成
- 生成秘鑰
//一直回車就好了
ssh-keygen -t rsa
會生成
id_rsa : 生成的私鑰文件
id_rsa.pub : 生成的公鑰文件
- 免密登錄方法
scp -p ~/.ssh/id_rsa.pub root@<remote_ip>:/root/.ssh/authorized_keys