您好,登錄后才能下訂單哦!
服務器二次登錄驗證:
目前比較流行的兩種方式
1 Google
https://github.com/google/google-authenticator
安裝 關閉 selinux git clone https://github.com/google/google-authenticator.git yum install libtool ./bootstrap.sh ./configure make && make install google-authenticator 獲取私鑰 客戶端輸入。 Do you want me to update your "/root/.google_authenticator" file (y/n) y Do you want to disallow multiple uses of the same authenticationtoken? This restricts you to one login about every 30s, but it increasesyour chances to notice or even prevent man-in-the-middle attacks (y/n) Do you want to disallow multiple uses of the same authenticationtoken? This restricts you to one login about every 30s, but it increasesyour chances to notice or even prevent man-in-the-middle attacks (y/n) y By default, tokens are good for 30 seconds. In order to compensate forpossible time-skew between the client and the server, we allow an extratoken before and after the current time. If you experience problems withpoor time synchronization, you can increase the window from its defaultsize of +-1min (window size of 3) to about +-4min (window size of17 acceptable tokens).Do you want to do so? (y/n) y If the computer that you are logging into isn't hardened against brute-forcelogin 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 vim /etc/pam.d/sshd 第一行添加 auth required pam_google_authenticator.so vim /etc/ssh/sshd_config 修改為 ChallengeResponseAuthentication yes service sshd restart ln -s /usr/local/lib/security/pam_google_authenticator.so pam_google_authenticator.so
通過 私鑰+時間戳 算出6位驗證碼,客戶端和服務端匹配,則通過驗證。
缺點:數據明文存儲本地,root賬號可以看到
應用商店搜索 Google身份驗證器 安裝
2 洋蔥
https://github.com/secken/secken-ssh
git clone https://github.com/secken/secken-ssh.git
sh dep.sh
tips
將keyboard interactive 放到第一位
通過秘鑰登錄的 無法進行二次驗證
參考:http://36kr.com/p/532998.html
http://www.xitongzhijia.net/xtjc/20141211/32369.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。