页次: 1
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
离线
批量替换密码 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' }
离线
页次: 1