zoukankan      html  css  js  c++  java
  • 4 saltstack ssh

     1、salt ssh

    https://docs.saltstack.com/en/latest/topics/ssh/index.html

    agent

    Salt ssh 串行

    执行的时候,发送给其他的,etc目录下,跑完后删除

    1.安装

    [root@linux-node1 ~]# yum install salt-ssh -y

     安装后生成roster,roster花名册

    记录目标的

     

    2、配置

    [root@linux-node1 salt]# vim /etc/salt/roster

    linux-node1:
      host: 192.168.194.131
      user: root
      passwd: redhat
      port: 22
    
    linux-node2:
      host: 192.168.194.132
      user: root
      passwd: redhat
      port: 22
    View Code

     

    3.配置ssh,需要key不验证

    [root@linux-node1 ~]# salt-ssh '*' test.ping 

    执行命令,不支持交互

    交互的两种方式

    1, 修改配置

    2 ,添加参数

     方法1:

    [root@linux-node1 ~]# salt-ssh '*' -r 'uptime'

    [root@linux-node1 ~]# salt-ssh '*' -r 'ifconfig'

    方法2ssh添加配置

    [root@linux-node1 ~]# vim .ssh/config

    StrictHostKeyChecking no

     

    执行命令

    [root@linux-node1 ~]# salt '*' cmd.run 'w'

    [root@linux-node1 ~]# salt-ssh '*' -r 'w'

    方法3:-i, --ignore-host-keys

    [root@localhost salt]# salt-ssh * test.ping -i

    4、执行命令

    [root@localhost salt]# salt-ssh * test.ping
    192.168.209.129:
        True
    192.168.209.130:
        True
    [root@localhost salt]# salt-ssh * test.ping
    192.168.209.130:
        True
    192.168.209.129:
        True
  • 相关阅读:
    fiddler 使用
    IO多路复用
    scrapy下载 大文件处理

    session见解
    自定义分页
    COOKIE
    ORM之老师管理
    ORM之学生管理
    ORM之班级管理
  • 原文地址:https://www.cnblogs.com/venicid/p/11276037.html
Copyright © 2011-2022 走看看