日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

一次性口令OPIE

口令用久了,就可能泄露,所以就有了一次性口令,用完就沒用了 。有沒有想過強化一下你的ssh登陸呢?
原理:服務器維護一個不斷變化的口令列表,這個列表是算出來的 。你每次用一個口令,用什么口令是預定好的,用過就失效,輪到下一個口令你不必非記住每個口令,登陸時,系統(tǒng)會給你提示,根據(jù)提示,再根據(jù)你事先知道的一個密碼,在安全的客戶端算出口令,再用其登陸 。
步驟:
1.初始化:需要初始化要登陸的系統(tǒng)口令序列,在你要使用的帳戶的提示符下:
%opIEpasswd -c -n 1000
Adding eliumao:
Only use this method from the console; NEVER from remote. If you are using
telnet, xterm, or a dial-in, type ^C now or exit with no passWord.
Then run opiepasswd without the -c parameter.
Using MD5 to compute responses.
Enter new secret pass phrase: xxxxx
Again new secret pass phrase: xxxxx
ID eliumao OTP key is 1000 el6652
LOB COCO DISK FAIN CRAG CAM
其中第一行中,-c是創(chuàng)建或初始化的意思,-n后面有個數(shù)字,是你要創(chuàng)建的口令序列的長度,用完還要重新初始化 。默認是500個 。
第七行,輸入你的密碼,這個密碼是用來以后根據(jù)系統(tǒng)提示算密碼的,或用來重新初始化 。密碼復雜些沒有壞處 。
第八行,再輸入一遍密碼 。
成功 。
下次想修改的話,直接用不帶-c的命令就好了 。
2.配置sshd_config使ssh使用opie的方式驗證口令
(注意,如果你用的是6.0,那么就不用第2步的配置了!!!!!)
請安裝/usr/ports/security/openssh-portable 。別忘了在/etc/rc.conf里加上這一行:
sshd_program=/usr/local/sbin/sshd
/etc/ssh/sshd_config
【一次性口令OPIE】————————————–
ChallengeResponseAuthentication yes #這一行不要是no,默認是yes
————————————–
3.配置PAM
(如果你用的是6.0,那么就不用第3步的配置了,相關配置文件的位置/etc/pam.d/sshd!!!!!)
以下是我的/etc/pam.conf中關于ssh的內(nèi)容
——————————————————————————–
# OpenSSH with PAM support requires similar modules. The session one is
# a bit strange, though…
#sshd auth sufficient pam_skey.so
sshd auth sufficient pam_opie.so no_fake_prompts
sshd auth requisite pam_opieaccess.so
#sshd auth sufficient pam_kerberosIV.so try_first_pass
#sshd auth sufficient pam_krb5.so try_first_pass
sshd auth required pam_Unix.so try_first_pass
sshd account required pam_unix.so
sshd password required pam_permit.so
sshd session required pam_permit.so
———————————————————————————
注意,第三行,我屏蔽掉了skey方式
第四行,我設置成使用opie認證就足夠了
第五行,我設置成opie認證通過是必須的,如果你還希望通過普通口令(UNIX系統(tǒng)口令)登陸,就不要這一行 。
OK,大功告成 。
4.試試看
%ssh ssh.eliumao.com
otp-md5 451 gw0965 ext
Password:
這里的password是這樣算的,在本地運行
%opiekey 451 gw0965
Using the MD5 algorithm to compute response.
Reminder: Don’t use opiekey from telnet or dial-in sessions.
Enter secret pass phrase: xxxxxxx
REIN BONN WAYS FILL CALF BRAD
注意,第一行,opiekey命令的參數(shù)就是ssh時這一行(otp-md5 451 gw0965 ext)得到的 。
第四行,輸入步驟1時那個secret pass phrase 。
最后一行,得到的就是登陸要用的口令 。
5.注意事項
顯然,步驟1的那個口令的安全十分重要 。產(chǎn)生時,最好通過安全的連接或者干脆就在服務器本地 。算一次性口令時,也要注意是在安全的終端上 。

推薦閱讀