Pertanyaan-pertanyaan ini tampaknya terkait:
- Duo Authentication Interactive Keyboard (Tidak ada jawaban.)
- https://serverfault.com/questions/417209/enabled-password-auth-on-sshd-now-keyboard-interactive-auth-hangs (Bug. Sistem saya mutakhir.)
Saya percaya keadaan saya cukup berbeda untuk memulai utas baru.
Saya telah mengatur ssh untuk menggunakan PAM, dengan Google-Authenticator. Saya telah menambahkan baris yang diperlukan untuk baik /etc/ssh/sshd_config
dan /etc/pam.d/sshd
dan telah menyiapkan Google Authenticator pada kedua komputer dan aplikasi. Kunci publik dari setiap sistem disalin di sisi lain.
Di /etc/ssh/sshd_config
:
PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive:pam
Di /etc/pam.d/sshd
:
#%PAM-1.0
auth required pam_securetty.so #disable remote root
# require google authenticator
auth required pam_google_authenticator.so
# but not password
#auth include system-remote-login
account include system-remote-login
password include system-remote-login
session include system-remote-login
Ini adalah output dari ssh -vvv 192.IP.address.0
:
OpenSSH_7.4p1, OpenSSL 1.0.2j 26 Sep 2016
...
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: ...
...
debug2: service_accept: ssh-userauth
...
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/trespaul/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok
debug3: sign_and_send_pubkey
Enter passphrase for key '/home/trespaul/.ssh/id_rsa':
debug3: send packet: type 50
debug3: receive packet: type 51
Authenticated with partial success.
debug1: Authentications that can continue: **keyboard-interactive**
debug3: **start over**, passed a different list keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: **keyboard-interactive**
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: **we sent a keyboard-interactive packet**, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (keyboard-interactive).
Antara dua tebal / bintang ganda terakhir ("metode auth berikutnya adalah interaktif kbd" dan "kami mengirim paket"), saya tidak diminta untuk OTP saya. Kenapa ini? Apa yang saya lewatkan?
Informasi tambahan
Saya di Arch. libpam-google-authenticator
diinstal dari AUR dengan make install
dll.
Edit: Log server
journalctl
di server memiliki yang berikut:
systemd[1]: Started OpenSSH Per-Connection Daemon (10.0.0.5:38150).
sshd[1376]: PAM unable to dlopen(/usr/lib/security/pam_google_authenticator.so): /usr/lib/security/pam_google_authenticator.so: cannot open shared object file: No such file or directory
sshd[1376]: PAM adding faulty module: /usr/lib/security/pam_google_authenticator.so
sshd[1376]: error: PAM: Module is unknown for paul from 10.0.0.5
sshd[1376]: Connection closed by 10.0.0.5 port 38150 [preauth]
Terima kasih.
/usr/lib/security/pam_google_authenticator.so
tidak ada. Instalasi, bagaimanapun, mengatakan bahwa itu berhasil ditambahkan ke / usr / lib / security.