Commit c64b4006 by see.liuh@gmail.com

增加playbook:root_changepass_ssh.yml

1 parent 42320fcb
......@@ -4,4 +4,8 @@
## license_deploy_tx1
文件夹内有单独的说明文件README.md
\ No newline at end of file
文件夹内有单独的说明文件README.md
## root_changepass_ssh.yml
批量修改root账户密码为vion,并开启用root账户登陆ssh
\ No newline at end of file
# cat change_user_pass.yml
---
- hosts: starnet
sudo: yes
gather_facts: false
tasks:
- name: change user passwd
user: name={{ item.name }} password={{ item.chpass | password_hash('sha512') }} update_password=always
with_items:
- { name: 'root', chpass: 'vion' }
- name: change ssh config
command: sed -i 's/^PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
- name: service restart
command: service ssh restart
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!