Google身份验证器操作步骤

ctrl+alt+printScreen 截图  q+tab 补齐

一、
搜索Google Authenticator ssh

date -s "2015-6-25 17:24"

yum -y install wget gcc make pam-devel libpng-devel
mkdir wpc
cd wpc/
ll
wget http://fukuchi.org/works/qrencode/qrencode-3.3.1.tar.gz  

mkdir soft

cd soft/

(mv ../qrencode-3.3.1.tar.gz ./)

ll

tar zxf qrencode-3.3.1.tar.gz  

cd qrencode-3.3.1  

./configure --prefix=/usr

make

make install



二、
搜索http://61.139.99.37/mysoft/Google_authenticator/  右键libpam-google-authentictor-1.0-source.tar.bz2属性
wget+属性中的地址

tar vxjf libpam-google-authenticator-1.0-source.tar.bz2  

cd libpam-google-authenticator-1.0  

make

make install




google-authenticator

y

y

y

y



复制Your new secret key is: FQTMHFXXU7KAC5GC
Your verification code is 776754
Your emergency scratch codes are:
  88914729
  87595312
  57769644
  63200612
  91012248



三、
vi /etc/pam.d/sshd           
添加auth required pam_google_authenticator.so   (i,ESC,:Wq!)  并保存


vi /etc/ssh/sshd_config

/ChallengeResponseAuthentication no 把它改成
ChallengeResponseAuthentication yes   并保存

service sshd restart



四、
vi /etc/sysconfig/selinux
复制SELINUX=enforcing  (yy-p复制-粘贴)
将SELINUX=enforcing改为
SELINUX=disabled  并保存


getenforce 为Erroring不行,为Permissive正确

setenforce 0
getenforce  为Permissive正确

ssh localhost

你可能感兴趣的:(Linux)