パスワードなしでOpenSSHDサーバーのクライアントとして "lsh"をどのように使用できますか?

パスワードなしでOpenSSHDサーバーのクライアントとして

試してみたいのですが、lshOpenSSHDサーバーと通信するのは非常に難しいようです。どうすればいいですか?

ベストアンサー1

OpenSSHクライアントの代替案を試す準備はできましたか?

それはあなたに良いです。lshwww.gnu.org/s/lsh/は、OpenSSHサーバーで使用できるGNUの代替手段です。残念ながらそれ簡単ではありません。

sshOpenSSHDを実行しているローカルホストにアクセスできるとします。最初の試みは次のとおりです。

$ lsh localhost
No seed file. Please create one by running
lsh-make-seed -o "/home/tange/.lsh/yarrow-seed-file".
lsh: No randomness generator available.

それでは、このファイルを作成しましょう。

$ mkdir .lsh
$ lsh-make-seed -o "/home/tange/.lsh/yarrow-seed-file"
lsh-make-seed: Reading system state...
lsh-make-seed: Got 150 bits of entropy from system state.
lsh-make-seed: Please type some random data. You better do this
lsh-make-seed: when connected directly to a console, typing over
lsh-make-seed: the network provides worse timing information, and
lsh-make-seed: more opportunities for eavesdropping.
----------------------------------------
........................................
lsh-make-seed: Got 182 keystrokes, estimating 200 bits of entropy.
lsh-make-seed: You can stop typing now.

lsh今、この機能を使用せずに /dev/urandomこの機能を持たないシステムで再入力するのは愚かなことです。

$ lsh localhost
lsh: Failed to open `/home/tange/.lsh/host-acls' for reading (errno = 2): No such file or directory
lsh: Protocol error: Algorithm negotiation failed.

lshこれは、最新のOpenSSHDで使用するときに互換性のないパスワードが選択されたためです。使用-c aes256-ctr- なぜ自動的に行われないのかわかりません。

$ lsh -c aes256-ctr localhost
lsh: Failed to open `/home/tange/.lsh/host-acls' for reading (errno = 2): No such file or directory
lsh: Server's hostkey is not trusted. Disconnecting.
lsh: Protocol error: Bad server host key

良いですが、十分ではありません。妄想を減らすと、lsh次のような利点が得られます。

$ lsh -c aes256-ctr --sloppy-host-authentication localhost
lsh: Failed to open `/home/tange/.lsh/host-acls' for reading (errno = 2): No such file or directory
Received unauthenticated key for host localhost
Key details:
Bubble Babble: xitem-suten-vedyd-hibuv-naril-nisog-luvet-dagik-negem-kykeb-bexyx
Fingerprint:   4b:9f:4b:4d:10:6b:09:2b:be:ee:df:48:a0:75:d3:9a
Do you trust this key? (y/n) y
Last login: Mon Dec  7 08:11:58 2015 from 192.168.1.103
$ 

lshこのホストキーを信頼できるホストキーに追加できます。

$ lsh -c aes256-ctr --sloppy-host-authentication --capture-to ~/.lsh/host-acls localhost
Received unauthenticated key for host localhost
Key details:
Bubble Babble: xitem-suten-vedyd-hibuv-naril-nisog-luvet-dagik-negem-kykeb-bexyx
Fingerprint:   4b:9f:4b:4d:10:6b:09:2b:be:ee:df:48:a0:75:d3:9a
Do you trust this key? (y/n) y
Password for tange: 
Last login: Fri Jan  8 12:46:57 2016 from localhost
$ 

lshその後、通常のパスワードを使用してログインできます。

$ lsh -c aes256-ctr localhost
Password for tange: 
Last login: Fri Jan  8 12:48:36 2016 from localhost
$ 

クライアントキーを承認するには、キーをOpenSSH形式に変換して次に追加します.ssh/authorized_keys

$ lsh-keygen | lsh-writekey
xxxxxx
xxxxxx
Enter new passphrase: 
Again: 
$ lsh-export-key --openssh < ~/.lsh/identity.pub | lsh -c aes256-ctr localhost 'cat >>.ssh/authorized_keys'
Passphrase for key `tange@hk': 
Password for tange:

これで、lshキーを使用してOpenSSHサーバーに接続できます。パスワードの入力を防ぐために、クライアントキーを暗号化しないでください。

$ lsh-keygen | lsh-writekey -c none
xxxxxx
xxxxxx
$ lsh-export-key --openssh < ~/.lsh/identity.pub | lsh -c aes256-ctr localhost 'cat >>.ssh/authorized_keys'
Password for tange: 
$ lsh -c aes256-ctr localhost
Last login: Fri Jan  8 12:48:40 2016 from localhost
$ 

おすすめ記事