Mac OS X Lion 和 sshpass

发布于 2024-11-25 12:09:15 字数 508 浏览 4 评论 0原文

我已从 Mac OS X Snow Leopard 升级到 Lion。我在 sshpass 中使用了多个脚本,但在升级到 Lion 后,出现以下错误:

Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 502
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

我只能使用 sshpass 连接或手动输入密码。没有公钥/私钥方式。我已经重新安装了 MacPorts 和 sshpass。

我如何获得 ssh-askpass?如何配置 /dev/tty

问候!

I've upgraded from Mac OS X Snow Leopard to Lion. I used several scripts with sshpass but after I upgraded to Lion the following error appears:

Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 502
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

I can only connect with sshpass or type the password manually. No public/private key way. I've reinstalled MacPorts and sshpass.

How can I get ssh-askpass? How can I configure /dev/tty ?

Greets!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰雪之触 2024-12-02 12:09:15

我认为 sshpass 中存在一个无法删除 DISPLAY 的错误。在运行 sshpass 之前尝试取消设置 DISPLAY。前任:

unset DISPLAY; sshpass -p pass ssh host

I think there is a bug in the sshpass that don't remove DISPLAY. Try to unset DISPLAY before run sshpass. EX:

unset DISPLAY; sshpass -p pass ssh host
你又不是我 2024-12-02 12:09:15

它困扰了我很长时间,终于找到了提示此处

简单来说,如果有人想在 ma​​c lion 中执行以下操作:

sshpass -p 通过 ssh user@host

他只需要:

  1. 设置一个名为pass.sh的脚本,内容如下:

    <块引用>

    回声传递

  2. 设置环境变量

    <块引用>

    导出 SSH_ASKPASS=~/bin/pass.sh

  3. 现在可以通过以下方式完成 ssh:

    <块引用>

    sshpass ssh 用户@主机

如果你想从钥匙串中获取密码,你最好看这个的第二个答案 链接

it stuck me for a long time, and finally found the hint here:

in simplicity, if one wants to do something like following in mac lion:

sshpass -p pass ssh user@host

he only needs to:

  1. set up a script called pass.sh with following:

    echo pass

  2. set up the environment variable

    export SSH_ASKPASS=~/bin/pass.sh

  3. the ssh could now be done by this:

    sshpass ssh user@host

If you want to get the password from the keychain, you better watch the second answer of this link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文