免密碼登入遠程主機(SSH copy id)
如果你有 SSH 金鑰就能免密碼登入遠程主機 先決條件 假設在你的系統安裝了 OpenSSH。 產生 SSH 金鑰(假設你沒有) 執行 ssh-keygen 產生 ssh key $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key ... 執行指令 假設你要登入的遠程指定為 ssh {username}@{remote.ip} 使用 ssh-copy-id 複製金鑰到遠程主機,這期間會問你登入密碼 $ ssh-copy-id {username}@{remote.ip} The authenticity of host '{remote.ip}' can't be established. ECDSA key fingerprint is xxxxxx. Are you sure you want to continue connecting (yes/no)? yes /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 {username}@{remote....