首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >ubuntu ssh configue Google Authenticator

ubuntu ssh configue Google Authenticator

作者头像
上山打老虎了
发布2022-06-14 18:04:33
发布2022-06-14 18:04:33
48000
代码可运行
举报
文章被收录于专栏:ArticleArticle
运行总次数:0
代码可运行

先安装ssh-server

代码语言:javascript
代码运行次数:0
运行
复制
apt-get install openssh-server

安装 Google Authenticator

代码语言:javascript
代码运行次数:0
运行
复制
git clone git@github.com:google/google-authenticator-libpam.git

#安装依赖工具
apt-get install autoconf automake libtool
apt-get -y install libpam0g-dev

./bootstrap.sh
./configure
make
sudo make install

Do you want authentication tokens to be time-based (y/n) y
https://www.google.com//chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/jolestar@xxxxx%3Fsecret%xxxxxxxx
Your new secret key is: xxxxxx
Your verification code is xxxxx
Your emergency scratch codes are:
  xxxxxxxx

Do you want me to update your "/home/jolestar/.google_authenticator" file (y/n) y

# 禁止同一个token被多个人使用
Do you want to disallow multiple uses of the same authentication
token? This restricts you to one login about every 30s, but it increases
your chances to notice or even prevent man-in-the-middle attacks (y/n) y

#是否需要延长过期时间,默认是30秒,但允许提前和延后一个段,所以过期时间是1分钟30秒。
By default, tokens are good for 30 seconds and in order to compensate for
possible time-skew between the client and the server, we allow an extra
token before and after the current time. If you experience problems with poor
time synchronization, you can increase the window from its default
size of 1:30min to about 4min. Do you want to do so (y/n) n

#是否启用频次限制
If the computer that you are logging into isn't hardened against brute-force
login attempts, you can enable rate-limiting for the authentication module.
By default, this limits attackers to no more than 3 login attempts every 30s.
Do you want to enable rate-limiting (y/n) y

至此, Google Authenticator 的安装已经完成。

然后输入手机上生成的code 即可

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017年03月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档