2016-11-17 97 views

回答

1

爲了避免您可以使用下一句口令認證:

ssh -o PasswordAuthentication=no [email protected] 

這禁用「手動」認證,但你需要另一種方法來登錄,如果不是你會得到這樣的錯誤:

Permission denied (publickey,password). 

也許你有一些問題與id_rsa

如果你想用rsync的使用(如你的例子),你必須把命令用引號(「):

rsync -v -r -l -e "ssh -o PasswordAuthentication=no" ctxt [email protected]:/home/ 

您可以在here

+0

使用直接的ssh它可以工作,但使用rsync失敗。我錯過了什麼?謝謝。 '[lnx5〜] $ rsync的-v -l -r -e ssh的-o的PasswordAuthentication =無ctxt [email protected]:/家庭/ [email protected]'s密碼:' –

+0

更新我的答案 –

1

使用批處理模式,以防止SSH提示輸入密碼等尤其如果你是通過rsync運行。 (我假設你將建立一個基於口令認證)

ssh -o BatchMode=yes [email protected] command 
+0

我仍然看到提示。 dropbear ssh是否不支持batchmode選項? 'lnx〜#rsync -v -r -l -e ssh -o BatchMode = yes -i/root/ssh/id_rsa -y -y samp.txt [email protected]:/ home/ [email protected]。 13.1的密碼:' –