-
免密登錄:
只要把本機的 ~/.ssh/id_rsa.puh的內容,粘貼到 遠程機器的 ~/.ssh/authorized_keys中去,就可以免密登錄啦
或者: ssh-copy-id -i .ssh/jump_machine.pub user@remoteip -
跳板機問題:
在家辦公,需要跳板機到公司vpn網絡,再連接到需要的remote machine上,一直用的是Royal TSX。
今天發現可以配置ssh_config
Host jumpmachine
HostName 192.168.1.2
User vivi
Port 10022
Host remotedev
HostName remotedev-******.com
ProxyCommand ssh jumpmachine -W %h:%p
User mydesktopusername
已經把本地id_rsa.puh內容貼到了 jumpmachine, 可以免密登錄jumpmachie,只輸入remotedev密碼即可;
又把本地id_rsa.puh 內容貼到 remotedev, 就可以省掉2次密碼