安装方式一: Liunx yum -y install epel-release yum -y install google-authenticator ubuntu sudo apt update #末尾添加 重启ssh systemctl restart sshd #ubuntu sudo 配置google authenticator 首要条件:先切换到你需要设置的帐号 google-authenticator
Google令牌 #0 github https://github.com/Coxhuang/google-authenticator.git #1 使用操作 调用绑定google-authenticator 另一部分就是客户端(用户在手机/电脑上安装的app或者插件) (服务端)随机生成一个字符串,并将该字符串+用户唯一标示(这里我用的用户唯一标示是邮箱)构造成固定的格式生成一个二维码 (客户端)手机下载google-authenticator Google提供的代码,把App提供的验证码+邮箱进行校验 #3 实例讲解 需求分析 用户登陆时,除了需要用户名和密码,还需要提供该用户对应的Google令牌验证码 使用步骤 新增用户(跳过这一步骤) 绑定google-authenticator
google-authenticator 运行命令之后,您将被问到几个问题。第一个问题是,身份验证令牌是否应该是基于时间的。 这样就可以使用google-authenticator生成新密钥。 要查看所有选项,可以输入google-authenticator --help。 您可以简单地使用相同的.google-authenticator文件,因为文件中没有存储特定于用户的数据。 google-authenticator。
epel仓库 dnf install epel-release google-authenticator dnf install google-authenticator google-authenticator 版本 rpm -qa |grep google-authenticator google-authenticator-1.07-1.el8.x86_64 二维码生成工具 不安装二维码生成工具 ,google-authenticator将无法生成二维码,但可以将生成的链接复制到浏览器中生成二维码。 dnf install qrencode 运行 google-authenticator ? ? 身份验证优化 局域网内特定网段访问主机不进行google-authenticator验证,其他网段访问需要进行google-authenticator验证。。。
Ubuntu 16.04.1 LTS 64bit OpenSSH server 1、安装 SSH 服务 sudo apt update sudo apt install openssh-server 2、安装 Google-Authenticator sudo apt update sudo apt install libpam-google-authenticator 3、生成密钥 google-authenticator 过程中全部按 y。 4、配置手机 app 用 Google-Authenticator、洋葱、Authy、身份宝 等扫描上一步生成的二维码即可。 我个人使用的是 Authy。
libpam-google-authenticator-1.0 # make # make install 而后,google的验证模块就会被复制到/lib64/security目录下,而用来生成密钥的可执行程序:google-authenticator Tips:编译安装google-authenticator需要pam-devel依赖包,如果没有的话,请首先安装该依赖包。 比如,我们想为账户:liuke 增加一层额外的验证机制,则先通过google-authenticator生成密钥: [liuke@localhost ~]$ google-authenticator 前面执行google-authenticator命令后首先输出的信息,那个HTTP的网址,打开你就会发现,原来它是个图片二维码,扫描即可。若网址打不开也没关系,选择密钥就OK了。
libpng-devel 3.2.2 Google Authenticator PAM插件安装 # 可在google的github下载 wget https://github.com/google/google-authenticator install 安装完成后会在 /usr/local/lib/security/pam_google_authenticator.so生成一个 库文件, 系统还会多在/usr/local/bin目录生成一个google-authenticator Google Authenticator 4.1 初始配置 Google Authenticator [root@clsn.io /lib64/security] clsn.io Blog WebSite #google-authenticator 各自程序的下载地址为: chrome google-authenticator插件 firefox google-authenticator插件 6.3 Python 客户端 import hmac /201305/392443.htm https://blog.csdn.net/bwlab/article/details/51321746 https://github.com/google/google-authenticator
/configure –prefix=/usr/local/google-authenticator
make && make install
4、拷贝google的身份验证器pam模块到系统下 cp /usr/local/google-authenticator/lib/security/pam_google_authenticator.so /lib64/security/
5、配置sshd /google-authenticator #基于当前用户做验证,如果切换别的系统用户,请登陆其他用户,执行此命令即可
Do you want authentication tokens to be
sources #如果时区不对的话,可以拷贝你当前地区所在地的时区到系统运行的时区 #cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ###安装google-authenticator /configure make && make install #运行google-authenticator命令,它将会在当前登陆用户的家目录中生成一个新的密钥 cd ~ google-authenticator
pam_google_authenticator.so /lib64/security/ 手机上下载google身份验证器 生成验证密钥 [root@vm212664 ~]# yum -y install google-authenticator [root@vm212664 ~]# google-authenticator 会出现一个二维码,在手机上打开google身份验证器,扫描该二维码 图片 修改配置 vim /etc/pam.d/sshd
sudo apt-get install libpam-google-authenticator 在 Fedora 上安装 Google Authenticator: $ sudo yum install google-authenticator 在 CentOS 上安装 Google Authenticator ,需要首先启用 EPEL 软件库,然后运行如下命令: $ sudo yum install google-authenticator source.tar.bz2 $ cd libpam-google-authenticator-1.0 $ make 如果构建成功,你会在目录中看到 pamgoogleauthenticator.so 和 google-authenticator 我们将详细叙述如何完成这些操作: 生成验证密钥 在Linux主机上运行Google认证器 $ google-authenticator 你将看到一个QR码,它使用如下图形表示我们数字形态的密钥。
$ yum install -y qrencode 安装谷歌身份验证器 这个时候很多教程会让你从 google-authenticator 仓库中下载相应安装包。 $ yum install google-authenticator 不过通过软件仓库安装的身份验证器的版本很老。如果你需要新版本的身份验证器,可以通过以下命令来下载。 1)执行 google-authenticator,由于我们之前已经安装了 qrencode,那么这个时候会生成一个超级超级巨大的二维码,给各位感受一下: 红色内容是生成的密钥,很重要。 安装完后,打开 App,点击 “开始设置”,选择 “扫描条形码” 扫描上面 google-authenticator 命令生成的二维码或者是选择 “输入密钥”,然后手机上就能看到对应的六位数认证码了。 $ google-authenticator --secret="/文件路径/用户名" 然后更改 /etc/pam.d/sshd 内的路径配置。
2、安装Google Authenticator yum install google-authenticator -y ? 3、google-authenticator初始化配置 哪个账号需要动态验证码,切换到该账号下操作进行操作 下面创建如下一个账户进行操作 useradd yuanfan passwd yuanfan su - yuanfan google-authenticator Your new secret key is: G5RR2IJG2X74MI4ADW622R6PUA #如果在手机的谷歌身份验证器上不想通过
CentOS 6系统 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm yum install google-authenticator CentOS 7系统 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install google-authenticator /configure make && make install 配置 1、配置验证器 google-authenticator 输出如下: Do you want authentication tokens
这是通过运行我们刚才安装的 Debian 软件包完成的,在命令行下运行: google-authenticator 运行这个程序时,会问到几个问题。 如果以后需要更改这些选项,你可以简单地重新运行 google-authenticator 并选择不同的选项。 当你运行 google-authenticator 时,一个二维码会被打印到终端上,二维码下方的代码样例如下: Your new secret key is: 75YD5PTE6R65BYFR2AWQGUV6FE
步骤 1️⃣ 安装模块 sudo yum install epel-release -y sudo yum install google-authenticator -y 2️⃣ 为用户生成密钥执行: google-authenticator 命令会生成一个二维码、密钥及若干备用验证码。
Authenticatorsudo apt-get install libpam-google-authenticator # 对于Debian/Ubuntu系统sudo yum install google-authenticator # 对于CentOS/RHEL系统配置 Google Authenticator运行 google-authenticator 命令,按照提示生成密钥并配置。
这是通过首先运行我们刚刚安装的程序完成的: google-authenticator 运行这个程序时,会问到几个问题。你应该以适合你的设置的方式回答,然而,最安全的选项是对每个问题回答 y。 如果以后需要更改这些选项,您可以简单地重新运行 google-authenticator 并选择不同的选项。 当你运行 google-authenticator 时,一个二维码会被打印到终端上,有些代码看起来像这样: Yournew secret key is: VMFY27TYDFRDNKFY Your verification
from Google Authenticator with small modifications from * {@see <a href="http://code.google.com/p/<em>google-authenticator</em> doc 身份宝 <em>google-authenticator</em> Java 接入 Google Authenticator 使用OTP动态口令(每分钟变一次)进行登录认证 GoogleAuth aerogear-otp-java
下载地址:http://wordpress.org/extend/plugins/google-authenticator/ 要使用这个插件实现两步验证,你的 Google 账号要具有两步验证功能,具体设置请点击