1、编辑Hosts文件:
[root@yqtrack-elk01 /]# vim /etc/hosts
2、同步Host文件:
[root@yqtrack-elk01 /]# scp /etc/hosts yqtrack-elk02:/etc/[root@yqtrack-elk01 /]# scp /etc/hosts yqtrack-elk03:/etc/
3、修改各服务器elk账号密码:(elk/password)
[root@yqtrack-elk01 /]# passwd elk[root@yqtrack-elk02 /]# passwd elk[root@yqtrack-elk03 /]# passwd elk
4、切换elk账户:
[root@yqtrack-elk01 /]# su elk
5、生成公钥/私钥对:
[elk@yqtrack-elk01 /]$ ssh-keygen -t rsa -P ''
6、导入公钥到认证文件:
[elk@yqtrack-elk01 .ssh]$ cat /home/elk/.ssh/id_rsa.pub >> /home/elk/.ssh/authorized_keys[elk@yqtrack-elk01 /]$ chmod 600 /home/elk/.ssh/authorized_keys
7、生成服务器认证列表文件:
[elk@yqtrack-elk01 /]$ ssh-keyscan yqtrack-elk01 yqtrack-elk02 yqtrack-elk03 >> /home/elk/.ssh/known_hosts
8、同步认证文件至节点服务器:
[elk@yqtrack-elk01 ~]$ scp -rp /home/elk/.ssh yqtrack-elk02:/home/elk/[elk@yqtrack-elk01 ~]$ scp -rp /home/elk/.ssh yqtrack-elk03:/home/elk/
9、测试SSH无密码访问:
[elk@yqtrack-elk01 ~]$ ssh yqtrack-elk02
[elk@yqtrack-elk01 ~]$ ssh yqtrack-elk03
SSH穿越跳板机:
ssh -o "ProxyCommand ssh -p 22 redmine-test -A -W %h:%p" -p 22 root@192.168.1.211scp -o "ProxyCommand ssh -p 22 redmine-test -A -W %h:%p" known_hosts -p 22 root@192.168.1.211:/usr/local/src/
[THE END]