不要使用密码认证。使用 ssh 密钥对。
Karthik@A $: ssh-keygen #keep the passphrase empty
Karthik@A $: ssh-copy-id B #enter your B password
#^ this will copy your public key to Karthik@B:.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
从此,你应该能够从SSH一到乙(通过扩展,scp从一到乙)没有密码。