【问题标题】:pam_ssh_agent_auth - No ssh-agent could be contactedpam_ssh_agent_auth - 无法联系到 ssh 代理
【发布时间】:2021-03-13 03:02:46
【问题描述】:

我正在努力让 pam_ssh_agent_auth 在我的 Ubuntu 18.04 服务器上工作。

/etc/sudoers我已经添加了

Defaults    env_keep+=SSH_AUTH_SOCK

/etc/pam.d/sudo

auth sufficient pam_ssh_agent_auth.so file=/etc/ssh/sudo_authorized_keys

但是,sudo 时我仍然需要提供密码。

/var/log/auth.log 说:

Beginning pam_ssh_agent_auth for user myuser
pam_ssh_agent_auth: Attempting authentication: `myuser' as `myuser' using /etc/ssh/sudo_authorized_keys
pam_ssh_agent_auth: No ssh-agent could be contacted
pam_ssh_agent_auth: Failed Authentication: `myuser' as `myuser' using /etc/ssh/sudo_authorized_keys

我正在使用 putty SSH 到我的服务器,并且启用了 Allow agent forwarding

有人可以帮忙吗?

【问题讨论】:

    标签: ubuntu ssh ubuntu-18.04 pam


    【解决方案1】:

    这可能是由于计算机上没有实际运行 Pageant。您需要将您的 PPK 添加到 Windows 上的 Pageant 中,并让它运行。

    PuTTY 中有一个选项可以先使用 Pageant 登录:

    Connection > SSH > Auth,默认选中Attempt authentication using Pageant。确保已选中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-09-29
      • 2023-01-28
      • 2016-02-06
      • 2021-03-24
      • 2018-03-11
      • 1970-01-01
      • 2019-02-24
      相关资源
      最近更新 更多