#Ubuntu systems apt-get install libpam-google-authenticator #CentOS and Red Hat Enterprise Linux yum install google-authenticator auth required pam_google_authenticator.so UsePAM yes ChallengeResponseAuthentication yes mkdir .ssh chcon -t ssh_home_t -R .ssh ls -Zd .ssh/ auth required pam_google_authenticator.so secret=/home/${USER}/.ssh/.g AuthenticationMethods publickey, keyboard-interactive auth required pam_unix.so @include common-auth auth [success=done default=ignore] pam_access.so accessfile=/etc/security/localnet.conf + : ALL : 192.168.1.0/24 + : ALL : LOCAL - : ALL : ALL