使用 kerberos 进行 SSH 无密码登录

使用 kerberos 进行 SSH 无密码登录

我尝试登录仅支持使用 kerberos 身份验证登录的服务器。这是我尝试的:

kinit [email protected]
aklog -c foo.org
ssh server

但随后又要求我输入密码。

这是我的条目~/.ssh/configserver我的/etc/ssh/ssh_config为空):

Host server
    HostName someserver.foo.org
    User user
    ForwardX11 yes
    ForwardX11Trusted yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials yes

据同事称,这(或类似的东西)对他们来说很有效。我可以使用 kerberos 令牌登录其他计算机。我认为这与我的有关/etc/krb5.conf,但我不知道要寻找什么。我尝试将其/etc/krb5.conf从服务器复制到我的工作站,但没有成功。

这是我运行时的部分输出ssh -vvv server

debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Server not found in Kerberos database

debug1: Unspecified GSS failure.  Minor code may provide more information
Server not found in Kerberos database

debug1: Unspecified GSS failure.  Minor code may provide more information


debug2: we sent a gssapi-with-mic packet, wait for reply

如何使用本地 kerberos 令牌登录?我究竟做错了什么?

答案1

您可能需要通过为机器本身创建主体来将服务器添加到 kerberos 数据库(又名 KDC)。

如果您正在使用 KDC 运行 Windows Active Directory,则可以使用 ktpass.exe 将主机添加到 KDC。

如果您运行的是 Windows 或 Linux Kerberos KDC,则可以在 Linux shell 中使用 ktutil 命令来访问 kerberos 数据库的主体。

答案2

可能是 NTPD 服务已关闭,至少在我的情况下,当检查状态时,服务失败,日志具有 PANIC_STOP,请尝试以下步骤-

  1. systemctl stop ntpd
  2. systemctl status ntpd
  3. 请注意其中一台服务器/etc/ntpd.conf
  4. ntpdate <ABOVE SERVER>
  5. systemctl start ntpd

相关内容