模块
1.salt-ssh
yum install salt-ssh
vim /etc/salt/roster
centos6.5-06:
host:192.168.17.145
user:root
passwd:111111
port: 22
timeout: 30
问题: salt-ssh"*" test.ping
The host key needs to be accepted, toauto accept run salt-ssh with the -i flag:
Theauthenticity of host '192.168.17.145 (192.168.17.145)' can't be established.
RSA keyfingerprint is 4c:89:e6:46:95:cf:a9:52:df:ff:bf:9d:25:93:da:f2.
Are you sure you want to continue connecting(yes/no)?
解决方法:原因是无法输入yes命令无法继续执行
[root@bogon salt]# touch/root/.ssh/config
[root@bogon salt]# vim/root/.ssh/config
host 192.168.17.146 -------minion端ip
StrictHostKeyChecking no
[root@bogon salt]# salt-ssh "*"cmd.run "df -h"
centos6.5-06:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 18G 3.5G 13G 22% /
tmpfs 495M 96K 495M 1% /dev/shm
/dev/sda1 485M 35M 426M 8% /boot
本文详细介绍了在使用Salt-SSH进行远程管理时遇到主机密钥认证问题的解决方法,通过修改`/root/.ssh/config`文件设置StrictHostKeyChecking为no,成功解决了无法继续执行命令的问题。同时,展示了在CentOS 6.5环境下,使用Salt-SSH执行命令`df-h`获取磁盘使用情况的操作。
2317

被折叠的 条评论
为什么被折叠?



