Update Inventory and OpenSSH Playbook
This commit is contained in:
parent
dec43e1544
commit
1ff6340e74
@ -8,6 +8,6 @@
|
||||
[linux]
|
||||
10.0.1.2
|
||||
10.0.1.12
|
||||
10.0.1.13
|
||||
10.0.1.14
|
||||
10.0.1.15
|
||||
10.0.1.16
|
@ -1,11 +1,31 @@
|
||||
- hosts: linux
|
||||
remote_user: root
|
||||
become: true
|
||||
become_user: root
|
||||
tasks:
|
||||
- name: Update/install OpenSSH
|
||||
apt:
|
||||
name: openssh-server
|
||||
state: latest
|
||||
update_cache: yes
|
||||
- name: Add 'bhays' user
|
||||
user:
|
||||
name: bhays
|
||||
groups: sudo
|
||||
append: yes
|
||||
comment: Benjamin Hays
|
||||
- name: Update/install Sudo
|
||||
apt:
|
||||
name: sudo
|
||||
state: latest
|
||||
- name: Ensure .ssh user folder exists
|
||||
file:
|
||||
path: "/home/bhays/.ssh/"
|
||||
state: directory
|
||||
- name: Copy public key
|
||||
copy:
|
||||
src: ~/.ssh/authorized_keys
|
||||
dest: /home/bhays/.ssh/authorized_keys
|
||||
- name: Copy Secure Configuration File
|
||||
copy:
|
||||
src: ../Configs/sshd_config
|
||||
|
@ -13,7 +13,7 @@ MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@op
|
||||
LogLevel VERBOSE
|
||||
|
||||
#LoginGraceTime 2m
|
||||
#PermitRootLogin prohibit-password
|
||||
PermitRootLogin yes
|
||||
#StrictModes yes
|
||||
MaxAuthTries 5
|
||||
MaxSessions 8
|
||||
|
Loading…
Reference in New Issue
Block a user