#关闭selinux
sed -i 's@SELINUX=enforcing@SELINUX=disabled@' /etc/selinux/config
setenforce 0
#安装阿里epel
curl http://mirrors.aliyun.com/repo/epel-7.repo >/etc/yum.repos.d/epel.repo
#安装google-authenticator
yum -y install google-authenticator
#修改sshd
sed -i 's#^ChallengeResponseAuthentication no#ChallengeResponseAuthentication yes#' /etc/ssh/sshd_config
#修改PAM模块,修改google模块
sed -i '1a auth required pam_google_authenticator.so' /etc/pam.d/sshd
#生成二维码
google-authenticator
#重启sshd
systemctl restart sshd