安装GOOGLE-AUTHENTICATOR验证器

安装GOOGLE-AUTHENTICATOR验证器

1.安装epel源

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2.安装git级二维码工具

yum install -y git qrencode

3.安装开发包工具

yum groupinstall -y "Development Tools"

4.安装google-authenticator

git clone https://github.com/google/google-authenticator.git

cd google-authenticator/libpam/

sh bootstrap.sh

./configure && make && make install

cp -v /usr/local/lib/security/pam_google_authenticator.so /lib64/security/

5.生成基于技术的认证token(可以忽略时间错误)

google-authenticator --counter-based --force --window-size=1 --no-rate-limit

6.更改ssh级pam设置

## 修改PAM

vi /etc/pam.d/sshd

auth required pam_google_authenticator.so

## 修改SSH配置

ChallengeResponseAuthentication yes

UsePAM yes

service sshd restart

修改ssh的鉴权方式,改为键盘交互。

注意: 这里要把应急验证码记录下,防止验证坏掉以后无法登陆,也可以把ssh的公钥下载下来做备用登陆方式



本文转自 shouhou2581314 51CTO博客,原文链接:http://blog.51cto.com/thedream/1716647,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值