如何通过启用 TOTP 的 ssh 使用 Apache Guacamole RDG 管理服务器?

如何通过启用 TOTP 的 ssh 使用 Apache Guacamole RDG 管理服务器?

我在 Ubuntu 22.04 LTS 上设置了一个 Apache Guacamole 服务器 (v1.4.0)。还安装了模块 guacamole-auth-jdbc-mysql.jar、guacamole-auth-ldap.jar 和 guacamole-auth-totp.jar。openssh-server、tomcat9 和 java (openjdk-17) 是从 apt 存储库安装的。与我的服务器的所有连接均正常 (RDP、VNC、没有 TOTP 的 SSH),但 ssh 连接除外,这些连接通过 totp (google-authenticator) 进行了额外的保护。是否可以以某种方式建立连接,或者是否有办法直接使用密码输入 2FA,这样只需要一个提示 (如 <password>#<otp>)?我想明确使用一次性密码而不是 ssh 密钥。

目标系统上的auth.log中的错误消息如下:

Jan 25 10:19:58 <ssh-server> sshd[271678]: Connection from xxx.xxx.xxx.xx1 port xxxx on xxx.xxx.xxx.xx2 port 22 rdomain ""
Jan 25 10:20:04 <ssh-server> sshd[271678]: Postponed keyboard-interactive for <user> from xxx.xxx.xxx.xx1 port xxxx ssh2 [preauth]
Jan 25 10:20:04 <ssh-server> sshd[271716]: pam_krb5(sshd:auth): user <user> authenticated as <user>@<domain>
Jan 25 10:20:04 <ssh-server> sshd[271678]: Postponed keyboard-interactive/pam for <user> from xxx.xxx.xxx.xx1 port xxxx ssh2 [preauth]
Jan 25 10:20:04 <ssh-server> sshd(pam_google_authenticator)[271716]: Invalid verification code for <user>
Jan 25 10:20:04 <ssh-server> sshd[271678]: error: PAM: Authentication failure for <user> from xxx.xxx.xxx.xx1
Jan 25 10:20:04 <ssh-server> sshd[271678]: Failed keyboard-interactive/pam for <user> from xxx.xxx.xxx.xx1 port xxxx ssh2
Jan 25 10:20:04 <ssh-server> sshd[271678]: Connection closed by authenticating user <user> xxx.xxx.xxx.xx1 port xxxx [preauth]

先感谢您...

答案1

对于那些感兴趣的人:只需在编译之前通过简单地编辑源代码应用以下补丁即可。

https://github.com/apache/guacamole-server/pull/304/commits

它适用于旧版本,但也适用于当前版本 1.4.0。

相关内容