CentOS에 2FA인증을 위해 Google OTP를 설정한 후 패스워드와 OTP Code를 따로 입력하는 방법이 아닌 결합하여 한번에 입력하는 방법이다.
Google OTP설치 방법은 아래 필자의 블로그를 참조 한다.
2020/11/11 - [운영체제/Linux] - [Linux] Centos7에 Google OTP 설치 (2 Factor인증)
[Linux] Centos7에 Google OTP 설치 (2 Factor인증)
2 factor 인증을 위한 설정 방법이다. 구글 OTP인증이 아닌 다른 방식을 찾아 봤으나 대부분 구글 OTP를 이용하여 2Factor 인증을 하는 것으로 가이드가 되어 있다. 다른 블로그에도 상세 설명이 되어
louky0714.tistory.com
계정의 패스워드가 "user_pass" 라고 하고 google OTP에서 생성된 Code가 "234 678" 라면 "user_pass234678"을 한번에 입력하도록 하는 방법이다.
별도로 설정을 하지 않을 경우 따로따로 입력을 하게 된다.
설정을 변경하고 나면 한 번에 두개를 입력할 수 있도록 할 수 있다.
설정 방법은 간단하다.
/etc/pam.d/sshd에서 특정 옵션을 주석처리하면 된다.
[root@test ~]# vi /etc/pam.d/sshd
#%PAM-1.0
auth required pam_sepermit.so
#auth substack password-auth ### 주석
auth include postlogin
#### Google Authencatoe ( Google OTP Set)
#auth required pam_google_authenticator.so nullok ## 주석
auth required pam_google_authenticator.so no_increment_hotp nullok try_first_pass forward_pass ## 추가
~(생략)
즉, "auth substack password-auth" 라인은 주석 처리 하고 "auth required pam_google_authenticator.so " 뒤에 google authenticator옵션을 nullok외에도 추가 한다.
#auth substack password-auth ## 주석 처리
auth required pam_google_authenticator.so no_increment_hotp nullok try_first_pass forward_pass
no_increment_hotp | 로그인 실패시 카운트를 올리지 않는 옵션 |
try_first_pass | 이전단계에서입력받은 패스워드가 있으면 그걸 사용해서 테스트를 수행하며 입격받은 패스워드가 없을 경우 새롭게 패스워드를 입력받아 사용한다는 의미 |
forward_pass | Client에서 2factor인증을 하지 못하는 경우 Password입력시 Password_Verification_code로 처리하도록 하는 옵션 |
별도의 daemon재기동 없이 바로 반영된다.
'운영체제 > Linux' 카테고리의 다른 글
[Linux] mount fail "Mounting V5 Filesystem...Ending clean mount" Error 발생 (1) | 2021.12.07 |
---|---|
[Linux] mount fail : structure needs cleaning (구조에 청소가 필요합니다) (0) | 2021.04.28 |
[Linux] Centos7에 Google OTP 설치 (2 Factor인증) (0) | 2020.11.11 |
[Linux] dell omsa command (옴사 명령어) - omreport (0) | 2020.11.05 |
[Linux] Apache https로 redirect 예외처리 (특정 URL만 redirect되지 않도록....) (1) | 2020.10.26 |