• saltstack安装


    环境:

    
    172.16.202.104 stack-master
    
    172.16.202.108 stack-node01
    
    172.16.202.105 stack-node02
    
    

    安装

    • 导入yum源认证的公钥
    
    rpm --import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub
    
    
    • 添加yum源
    
    [saltstack-repo]
    
    name=SaltStack repo for RHEL/CentOS $releasever
    
    baseurl=https://repo.saltstack.com/yum/redhat/releasever/releasever/
    
    basearch/latest
    
    
    enabled=1
    
    gpgcheck=1
    
    gpgkey=https://repo.saltstack.com/yum/redhat/releasever/releasever/
    
    basearch/latest/SALTSTACK-GPG-KEY.pub
    
    
    
    • yum 安装软件即可

      • master
    
    yum install -y salt-master
    
    
    • Client
    
    yum install -y salt-minion
    
    
    • 在client修改配置文件,指定master
    
    sed -i '16s##master: salt#master: stack-master#g' /etc/salt/minion
    
    
    • 启动服务

      • 服务端
      
      /etc/init.d/salt-master start    
      
      chkconfig salt-master on
      
      
      • 客户端
      
      /etc/init.d/salt-minion start    
      
      chkconfig salt-minion on
      
      

    认证

    minion首次启动后会在minion端看到minion的私钥和公钥,salt会把公钥发送给master,master需授权认证之后,方能正常和客户端通信。

    使用salt-key 命令来处理client 认证

    
    salt-key -L   #显示所有minion的认证信息
    
    salt-key -a 192.168.0.100  #单独通过minion的证书
    
    salt-key -a 192.168.0.100 -y   #单独通过minion的证书,不需要手动验证
    
    salt-key -a 192.168.0.100 --include-all  # 单独通过minion的证书,包括所有状态
    
    salt-key -A  # 通过所有的minion的认证请求
    
    salt-key -d 192.168.0.100 # 单个删除证书
    
    salt-key -D  # 删除所有认证的minion证书
    
    

    以上是手动进程验证,saltstack还支持自动验证,需要修改/etc/salt/master 的#auto_accept: True

    认证通过之后,server会把自己的公钥传给客户端吗,保存,同时服务端也保存着客户端的公钥

  • 相关阅读:
    Security and Cryptography in Python
    Security and Cryptography in Python
    Security and Cryptography in Python
    Security and Cryptography in Python
    Security and Cryptography in Python
    Security and Cryptography in Python
    Security and Cryptography in Python
    微信小程序TodoList
    C语言88案例-找出数列中的最大值和最小值
    C语言88案例-使用指针的指针输出字符串
  • 原文地址:https://www.cnblogs.com/pycode/p/6270298.html
Copyright © 2020-2023  润新知