快轉到主要內容

linux 登入使用 google auth 二階段驗證

·73 字·1 分鐘·
PolloChang
作者
PolloChang
我是一隻雞

環境
#

  • OS: Debian 12

安裝及部屬
#

安裝
#

安裝 libpam-google-authenticator

1
sudo apt -y install libpam-google-authenticator

設定 ssh 登入
#

  • /etc/pam.d/sshd
1
auth required pam_google_authenticator.so
  • /etc/ssh/sshd_config
1
ChallengeResponseAuthentication yes #no

執行

1
google-authenticator

設定 gnmoe 登入
#

  • /etc/pam.d/gdm-password
1
2
3

auth required pam_google_authenticator.so
@include common-auth # 在這行之前

重起 gdm

1
sudo systemctl restart gdm