June 2026
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

June 2026
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

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>