公告

京东爆品,商家漏洞等,拼手速,手慢无! [点击收藏]

附:其它薅羊毛利器:
1,外卖红包:每天领取88元[点击收藏],反复可领。
2,车主加油打折服务:一键导航到加油站,选择油枪,支付时直减 [点击收藏]
3,电影票购买返利,覆盖所有主流院线。 [点击收藏]
4,打车-滴滴优惠
[点击收藏]
5,源头好货厂家直供[点击收藏]
6,POS机具(财务公司渠道版)[免费领取]

#1 2022-02-20 19:00:30

小天天
Moderator
注册时间: 2019-09-29
帖子: 886

ansible批量更换ssh pub key

ansible iplist -m authorized_key -a "user=root state=present key='{{ lookup('file', '/root/.ssh/id_rsa_2022_02.pub') }}'"  --private-key=/root/.ssh/id_rsa_2022

离线

#2 2023-11-22 11:41:24

小天天
Moderator
注册时间: 2019-09-29
帖子: 886

Re: ansible批量更换ssh pub key

批量替换密码 change-pass.yaml
---
- hosts: all
  tasks:
  - name: change user passwd
    user: name={{ item.user }} password={{ item.password | password_hash('sha512') }}  update_password=always
    with_items:
          - { user: 'root', password: 'xxx=xxx' }

离线

页脚

Powered by 华新企财帮

京ICP备19031397号-1