【问题标题】:Redirect the password prompt alert重定向密码提示警报
【发布时间】:2017-03-31 14:31:17
【问题描述】:

是否可以将密码提示警报重定向到文件或使其静音?

[lnx51 ~]$ ssh root@192.168.1.1 root@192.168.1.1's password:

【问题讨论】:

  • 您是否想要不询问密码并计划使用 id_rsa 或类似的东西?还是您要求自动输入密码?

标签: linux ssh rsync dropbear


【解决方案1】:

为了避免密码验证,你可以使用下一句:

  ssh -o PasswordAuthentication=no root@192.168.1.1

这会禁用“手动”身份验证,但您需要另一种方法来登录,否则您将收到如下错误:

  Permission denied (publickey,password).

也许你的 id_rsa 有问题

如果你想与 rsync 一起使用(作为你的例子),你必须把命令加上引号(“):

   rsync -v -r -l -e "ssh -o PasswordAuthentication=no"  ctxt root@192.168.6.2:/home/

你可以在here查看rsync选项

【讨论】:

  • 使用直接 ssh 可以工作,但使用 rsync 会失败。有什么我想念的吗?谢谢。 [lnx5 ~]$ rsync -v -r -l -e ssh -o PasswordAuthentication=no ctxt root@192.168.6.2:/home/ root@192.168.6.2's password:
【解决方案2】:

如果您通过 rsync 运行,请使用批处理模式来防止 ssh 提示输入密码等。 (我假设您将设置基于密码的身份验证)

ssh -o BatchMode=yes root@hostname command

【讨论】:

  • 我仍然看到提示。 dropbear ssh 是否不支持批处理模式选项? lnx~#rsync -v -r -l -e ssh -o BatchMode =yes -i /root/ssh/id_rsa -y -y samp.txt root@10.1.13.1:/home/ root@10.1.13.1's password:
猜你喜欢
  • 1970-01-01
  • 2020-06-01
  • 1970-01-01
  • 2019-08-21
  • 2018-05-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多