快捷搜索:   nginx

RSH/SSH配置Linux之间互信连接

一、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

(责任编辑:阿里猫)

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论