2016-11-17 96 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的密码:' –