RSH_SSH配置Linux之间互信连接Linux认证考试
文章作者 100test 发表时间 2009:12:08 20:47:48
来源 100Test.Com百考试题网
一、rsh的配置
1、安装软件、启动服务
chkconfig rsh on
chkconfig rlogin on
service xinetd reload
创建/etc/hosts.equiv 文件
touch /etc/hosts.equiv
chmod 600 /etc/hosts.equiv
chown root:root /etc/hosts.equiv
编辑
<.hostname1>.
<.hostname2>.
二、ssh配置
1、配置ssh,生成密钥
su - <.user_name>.
mkdir ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa # Accept the default settings.
exit
2、激活host1的user equivalency
Host1
su - <.user_name>.
cd ~/.ssh
cat id_rsa.pub >.>. authorized_keys
scp authorized_keys Host2:/<.user_home_diretory>./.ssh/
exit
3、激活host2的user equivalency
Host2
su - <.user_name>.
cd ~/.ssh
cat id_rsa.pub >.>. authorized_keys
scp authorized_keys Host1:/<.user_home_diretory>./.ssh/
两台主机都包含:authorized_keys
4、测试
su - <.user_name>.
ssh host1 date
ssh host2 date
ssh host1.localdomain date
ssh host2.localdomain date
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
exit