OPIE

OPIE

OPIE作業系統的全名叫做(開放掌上電腦集成環境,即 Open Palmtop Integrated Environment),基於 Qtopia,最類似於桌面領域中的 KDE,是為掌上電腦專門設計的LINUX作業系統。

OPIE (One-time Passwords In Everything)

原理

作業系統維護一個不斷變化的口令列表,這個列表是算出來的。每次用一個口令,用什麼口令是預定好的,用過就失效,輪到下一個口令不必非記住每個口令,登入時,系統會給出提示,根據提示,再根據事先知道的一個密碼,在安全的客戶端算出口令,再用其登入。

實際操作

以下操作在freebsd下,其他OS略有不同

1.初始化:

需要初始化要登入的系統的口令序列:
%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是創建或初始化的意思,-n後面有個數字,是要創建的口令序列的長度,用完還要重新初始化。默認是500個。第七行,輸入密碼,這個密碼是用來以後根據系統提示算密碼的,或用來重新初始化。密碼複雜些沒有壞處。 第八行,再輸入一遍密碼。

下次想修改的話,直接用不帶-c的命令就好了。

2.配置sshd_config使ssh使用opie的方式驗證口令

安裝/usr/ports/security/openssh-portable。在/etc/rc.conf里加上一行:

sshd_program="/usr/local/sbin/sshd

/etc/ssh/sshd_config
--------------------------------------
ChallengeResponseAuthentication yes #這一行不要是no,默認是yes
--------------------------------------

3.配置PAM

/etc/pam.conf中關於ssh的內容
--------------------------------------------------------------------------------
# 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系統口令)登入,就不要這一行。

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命令的參數就是ssh時這一行(otp-md5 451 gw0965 ext)得到的。
第四行,輸入步驟1時那個secret pass phrase。
最後一行,得到的就是登入要用的口令。

5.注意事項

步驟1的那個口令的安全十分重要。產生時,最好通過安全的連線活著乾脆就在伺服器本地。算一次性口令時,也要注意是在安全的終端上。

熱門詞條

聯絡我們