SSHはパスワードプロンプトなしでローカル接続を確立しません。

SSHはパスワードプロンプトなしでローカル接続を確立しません。

ループバックSSHを設定しようとすると、公開鍵をインストールした後にパスワードの入力を求められます。これはCentOS 6.4サーバーです。 ssh_config( grep -v ^# /etc/ssh/sshd_config | grep -v ^$) はここにあります:http://pastebin.com/Wg6iuL3x

関連する2人のユーザーはrootとgitです。

# clean root dir
cd ~/.ssh/ && rm -f $(ls | grep -i 'rsa\|dsa')
echo '' > known_hosts

# clean git dir
/home/git/.ssh/ && rm -f $(ls | grep -v 'authorized_keys')
chmod 0700 /home/git/.ssh && chmod 0600 /home/git/.ssh/authorized_keys
echo '' > authorized_keys

# back to root
ssh-keygen -f ~/.ssh/git_dsa -t dsa -N ''
cat ~/.ssh/git_dsa.pub >> /home/git/.ssh/authorized_keys

ssh -vvv git@localhost
git@localhost's password: 
...

これは-vログです

debug1: Next authentication method: publickey
debug1: Offering public key: git.rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Offering public key: git.dsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password

ログは-vvvここにあります:http://pastebin.com/j7iGvvMH

ノート

git_dsa.pub キーが表示または認識されないようです。問題の原因がわかりますか?

ベストアンサー1

SELinuxの使用に問題がある可能性があります。セキュリティを非常に重要にし(最終的にループバックSSHを使用している)、セキュリティを無効にしたくないと仮定した場合は、rootとして次のようにします。

 restorecon -R -v /home/git/.ssh

本当に無効にするには、/etc/selinux/configを編集し、そこでSELINUX = permissiveを設定します。

おすすめ記事