配上ssh等效连接

Posted hxlasky

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配上ssh等效连接相关的知识,希望对你有一定的参考价值。

配置等效连接
host1 :192.168.216.150
host2 :192.168.216.151
host3 :192.168.216.152

A.配置 host1 与 host2 的等效连接
步骤1.host1:192.168.216.150
[mysql@host1]$ mkdir ~/.ssh
[mysql@host1]$ chmod 700 ~/.ssh
[mysql@host1]$ ssh-keygen -t rsa
[mysql@host1]$ ssh-keygen -t dsa


步骤2.host2:192.168.216.151
[mysql@host2]$ mkdir ~/.ssh
[mysql@host2]$ chmod 700 ~/.ssh
[mysql@host2]$ ssh-keygen -t rsa
[mysql@host2]$ ssh-keygen -t dsa


步骤3.host1:192.168.216.150
[mysql@host1]$cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$ssh 192.168.216.151 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$ssh 192.168.216.151 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$scp ~/.ssh/authorized_keys 192.168.216.151:~/.ssh/authorized_keys


步骤4:
[mysql@host1]$ ssh 192.168.216.151 date
[mysql@host2]$ ssh 192.168.216.150 date

B.配置host1与host3的等效连接

1.host3
[mysql@host3]$ mkdir ~/.ssh
[mysql@host3]$ chmod 700 ~/.ssh
[mysql@host3]$ ssh-keygen -t rsa
[mysql@host3]$ ssh-keygen -t dsa

2.host1
[mysql@host1]$ssh 192.168.216.152 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$ssh 192.168.216.152 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$scp ~/.ssh/authorized_keys 192.168.216.152:~/.ssh/authorized_keys


B.配置host2与host3的等效连接
host2
[mysql@host1]$ssh 192.168.216.152 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$ssh 192.168.216.152 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[mysql@host1]$scp ~/.ssh/authorized_keys 192.168.216.152:~/.ssh/authorized_keys


偶尔有些机器上老是配置不成功,非要在root账号下配置。
解决办法(每台机器上root账号下执行):
在ssh用户的
cd /home/mysql/.ssh
chmod 710 authorized_keys

以上是关于配上ssh等效连接的主要内容,如果未能解决你的问题,请参考以下文章

蜂窝连接的 UIRequiresPersistentWiFi 等效项

内连接子查询 Django ORM 等效

SQL左反半连接等效查询

SqlAlchemy 等效于使用 FreeTDS 的 pyodbc 连接字符串

之间的 PROC SQL 上的哈希连接等效项

通过对两个日期之间的值求和来连接两个数据帧,sumif 等效