安装ssh:
[root@super63 ~]# yum install openssh –y #默认系统已经安装
启动ssh:
[root@super63 ~]# /etc/init.d/sshd start
生成私钥:
[root@super64 ~]# ssh-keygen
发送公钥到super63上:
[root@super64 ~]# ssh-copy-id -i/root/.ssh/id_rsa.pub 192.168.1.63
测试可以不用密码连接:
[root@super64 ~]# ssh 192.168.1.63
Last login: Wed Aug 5 00:01:22 2015 from 192.168.1.64
退出:
[root@super63 ~]# exit
拷贝文件到super63:
[root@super64 ~]# scp keepalived-1.2.16.tar.gz root@192.168.1.63:/data/
keepalived-1.2.16.tar.gz 100% 339KB 338.8KB/s 00:00
远程重启服务:
[root@super64 ~]# ssh 192.168.1.63 /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]