SSHサーバーで「authorized_keysは通常のファイルではありません」と言うのはなぜですか?

SSHサーバーで「authorized_keysは通常のファイルではありません」と言うのはなぜですか?

パスワード認証を無効にするために、puttygen生成キーを使用してログインを設定しようとしました。

puttygenで秘密鍵を保存し、次のように公開部分を.ssh / authorized_keysにコピーしました。

ssh-rsa AAAAB3Nza[...]1qRQ==

これがsshd_configで変更されたものです。

AuthorizedKeysFile .ssh/authorized_keys
UsePAM no

しかし、私のキーでログインしようとするたびに、サーバーはそれを拒否します。

ここに画像の説明を入力してください。

丸太:

error: key_read: type mismatch: encoding error
sshd[735]: error: key_from_blob: can't read key type
sshd[735]: error: key_read: key_from_blob
User root authorized keys /root/.ssh/authorized_keys is not a regular file

stat /root/.ssh/authorized_keys説明する:

68 3451018 drw------- 2 root wheel 6903510 512 "Jan 28 18:12:08 2016" "Jan 28 17:40:50 2016" "Jan 28 17:46:22 2016" "Jan 28 17:40:42 2016" 32768 8 0 /root/.ssh/.authorized_keys

FreeBSD 9.3の使用

ベストアンサー1

Ulrich Schwarzが指摘したように、.ssh/authorized_keys通常のファイルでなければなりません。あなたの場合は、ディレクトリのように見えます。ディレクトリを削除し、キーを含むテキストファイルを作成する必要があります。

おすすめ記事