OTPs: Using s/Key with SSH via OPIE

简介: Passwords are a quite debatable way of authentification.
Passwords are a quite debatable way of authentification. Passwords can be sniffed and widely used with other services, if the same passwords are used on more than one service. Biometrical identification is another form of authetication, but not quite suitable via remote access. An excellent standard is defined by s/Key. Read how to use this on Linux boxes... s/Key defines how one time passwords are implement within a standard. The classical skeyinit command doesn't exist on Linux out of the box, but on this point, the OPIE (One-time password is everything) implementation of s/Key takes place. First of all, we need OPIE. Debian etch currently provides opie-server as well as opie-client, which are both to be installed on the system. The main idea is the following: The administrator creates an s/Key seed. By creating the seed, a password is used which builds the direct basis of the afterwards generaded one-time-passwords. When logging in via SSH remotely, the server tells the user which password numbers of which seed is needed for the current login. The one time passwords are about six quite-readable English words, generated from the seed and the password number. So, we have to options at the client: We can calculate the password by ourselves on the client. This option has two disadvantages: First, we need the seed-password given while initializing OPIE on the server, and second, of course we need a client with OPIE installed. The second option is that the administrator gives out a list of passwords (let's say, 100), and we just give SSH the password it wants to hear. Let's start, first install the software: apt-get install opie-client opie-server Now, edit /etc/pam.d/ssh and comment out the line "@include common-auth", which is replaced by the following lines: auth sufficient pam_unix.so auth sufficient pam_opie.so auth required pam_deny.so Finally we have to tell SSH to use our OTPs, by editing /etc/ssh/sshd_config on the server: ChallangeResponseAuthentication yes Now let's login: # ssh user@host.tld opt-md5 498 v38294 ext, Response: SSH now tells us, which password it wants to hear. If we havn't printed out a password list, we can easily recalculate the password by typing the following command on a client (it's not relevant on which machine we do this; this can even be done on palmtops of cellphones): $ opiekey 498 v38294 OPIE will ask for the password seed, given at the server, and finally returns the password string, something like this: 498: NICK FAY SEND BERT ALTO BANE Type this password at the SSH login, and you're done. Capitilization is not relevant! If you're the admin of the server and doesn't want to give the seed password to the users, just print out a list of passwords, counting down from 499: $ opiekey -n 100 498 v38294 498 just tells OPIE the password-number to start with. This list can safely be given to your clients which need secure SSH accounts.
目录
相关文章
|
3月前
|
网络安全 数据安全/隐私保护
如何使用ssh key免密码登录服务器?
如何使用ssh key免密码登录服务器?
|
9月前
|
网络安全 Windows
GitLab配置ssh key
GitLab配置ssh key
|
11月前
|
安全 算法 Unix
|
11月前
|
安全 网络安全 Go
ED25519 SSH keys-gitcode ssh
ED25519 SSH keys-gitcode ssh
139 0
|
11月前
|
Ubuntu 网络安全 数据安全/隐私保护
Ubuntu系统中生成SSH Key
Ubuntu系统中生成SSH Key
1277 0
|
jenkins 持续交付 网络安全
Jenkins 配置 ssh key
Jenkins 配置 ssh key
1200 2
Jenkins 配置 ssh key
|
Linux 网络安全 数据安全/隐私保护
linux配置ssh-key
linux配置ssh-key
221 0
|
网络安全
将ssh key添加到ssh-agent使用命令ssh-add ~/.ssh/id_rsa结果报错
将ssh key添加到ssh-agent使用命令ssh-add ~/.ssh/id_rsa结果报错 Error connecting to agent: No such file or directory 开启ssh-agent:ssh-agent 报错: unable to start ssh-...
8773 0
|
网络安全
生成多个ssh key添加到ssh-agent测试连接报错
ssh key添加到ssh-agent测试连接报错 ssh -T git@github.com 如下报错,说明是~/.ssh/config文件问题.ssh/config: line 5: Bad configuration option: usekeychain修改配置文件解决问题,完整流程看这里Mac系统如下 Host new HostName github.
3092 0
|
开发工具 git 数据安全/隐私保护
TortiseGit 添加SSH-Key
TortoiseGit 使用扩展名为ppk的密钥,而不是ssh-keygen生成的rsa密钥。使用命令ssh-keygen -C "邮箱地址" -t rsa产生的密钥在TortoiseGit中不能用。 而基于git的开发必须要用到rsa密钥,因此需要用到TortoiseGit的putty key ...
1226 0