在debian上安装google-authenticator(ssh双重认证)
2015-06-27 10:50
676 查看
我的博客已迁移到xdoujiang.com请去那边和我交流 一、基础环境 1、版本 uname -v Debian 3.2.54-2 2、相关ip 10.131.172.202 二、安装google-authenticator 1、下载google-authenticator wget https://github.com/google/google-authenticator/archive/master.zip 2、解压 unzip master.zip 3、编译 cd /root/google-authenticator-master/libpam ./bootstrap.sh ./configure make make install 4、编译时出错提示及需要的包 1)./bootstrap.sh: 2: exec: autoreconf: not found 先查找下包 apt-cache search autoconf autoconf - automatic configure script builder 需要安装autoconf apt-get -y install autoconf 2)configure: error: Unable to find the PAM library or the PAM header files 先查找下包 apt-cache search libpam |grep dev libpam0g-dev - Development files for PAM 需要安装libpam0g-dev apt-get -y install libpam0g-dev 3)还需要libtool工具 apt-get -y install libtool
5、根据图上看到的相关的so文件在以下地方 ll /usr/local/lib/security -rwxr-xr-x 1 root staff 1038 Jun 26 22:33 pam_google_authenticator.la -rwxr-xr-x 1 root staff 125089 Jun 26 22:33 pam_google_authenticator.so 6、弄个软链接 ln -s /usr/local/lib/security/pam* /lib/x86_64-linux-gnu/security 三、pam及ssh 1、在/etc/pam.d/sshd配置里修改 tac /etc/pam.d/sshd |head -1 auth required pam_google_authenticator.so 2、先备份下并修改相应内容 cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak 修改ChallengeResponseAuthentication yes diff /etc/ssh/sshd_config /etc/ssh/sshd_config.bak 48c48 < ChallengeResponseAuthentication yes --- > ChallengeResponseAuthentication no 3、参数说明 ChallengeResponseAuthentication(是否允许质疑-应答(challenge-response)认证) 4、重启ssh服务 /etc/init.d/ssh restart [ ok ] Restarting OpenBSD Secure Shell server: sshd. 四、使用命令生成密钥 google-authenticator(生成密钥的时候回提示一些问题 我这里全部回答yes)
五、安卓手机上已经下载好了google身份验证器了(可以在QQ手机管家里找到身份验证器下载) 输入提供的密钥上输入刚才上面图片里的HFMMSP37F2YVFG5G(在.google_authenticator这个文件也有) 之后就可以看到6位数的密码 六、使用ssh连接 1、xshell客户端ssh链接
2、linux客户端ssh链接
七、参考文章 http://m114.org/google-authenticator-strengthen-ssh-login-security/ linux.cn/article-3725-1.html
相关文章推荐
- 谷歌 Project Zero 团队宣布新政策,漏洞披露前将有完整的 90 天缓冲期
- Android使用Google Map浅谈
- 专家解读:开源软件项目是否会被限制出口?
- 专家解读:开源软件项目是否会被限制出口?
- Google排名算法改变 不在以外部链为主
- Google Adsense 支票托收信息收集 (1-30-2007)
- Google Adsense常用技巧总结
- Google推广的十二点技巧
- google优化圣经做网站必备第1/3页
- Google AdSense英文高价关键词排行列表
- Debian灾难性漏洞
- Google 统计图表(Flash)小插件
- 2月份停止Google Adsense下线推介 将在中国地区停止投放
- 使用Google工具栏追踪 Blog 留言
- Google官方支持的NodeJS访问API,提供后台登录授权
- Debian 6.02 (squeeze)下编译安装 MySQL 5.5的方法
- jquery repeater 模仿 Google 展开页面预览子视图
- 据说是Google首页的网页模块拖动代码
- jquery与google map api结合使用 控件,监听器