March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Google-authenticator in CentOS

yum install gcc gcc++ make python python-devel git pam-devel

cd /tmp
git clone https://code.google.com/p/google-authenticator/
cd google-authenticator/libpam
make
make install
cd /tmp
rm -Rf google-authenticator/

 
To enable ssh 2 factor:

sed -i ‘1 a\ auth required pam_google_authenticator.so’ /etc/pam.d/sshd
Make sure that challenge response is listed as YES in your SSHD config


ChallengeResponseAuthentication yes

Login as the user you want to protect and run:

google-authenticator

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>