ssh для root без пароля
Помогите, пожалуйста, вот с какой проблемой. Никак не получается настроить доступ root-у между узлами по ssh без пароля. ssh-keygen -t и т. д. прекрасно работает, но только для непривилегированных пользователей. Ключи для всех без исключения генерируются при входе в систему с помощью скрипта, лежащего в /etc/profile.d (из OSCAR 4.2):
#!/bin/sh
user=`whoami`
home=`getent passwd | egrep "^$user\:" | awk -F: '{print $6}' | tail -1`
cd $home
file=$home/.ssh/id_rsa
type=rsa
if [ ! -e $file ] ; then
echo generating ssh file $file ...
ssh-keygen -t $type -N '' -f $file
fi
id="`cat $home/.ssh/id_rsa.pub`"
file=$home/.ssh/authorized_keys
if ! grep "^$id\$" $file >/dev/null 2>&1 ; then
echo adding id to ssh file $file
echo $id >> $file
fi
chmod 600 $home/.ssh/authorized_keys*
Картина следующая: для root:
#ssh -v s-cl1-01
[cut]
debug1: Host 's-cl1-01' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /root/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
Для пользователя всё прекрасно:
$ ssh -v s-cl1-01
[cut]
debug1: Host 's-cl1-01' is known and matches the RSA host key.
debug1: Found key in /home/kurylev/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/kurylev/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149 lastkey 0x96ed3b8 hint 1
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
У меня FC1, OpenSSH - из дистрибутива OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f