yay! so this actually works
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -3,17 +3,16 @@
|
|||||||
- tmp.kevinnlsamuel.com
|
- tmp.kevinnlsamuel.com
|
||||||
vars:
|
vars:
|
||||||
ansible_user: root
|
ansible_user: root
|
||||||
|
alt_ssh_port: 1023
|
||||||
name: setup server natsuco
|
name: setup server natsuco
|
||||||
tasks:
|
tasks:
|
||||||
- name: harden ssh
|
- name: harden ssh
|
||||||
block:
|
block:
|
||||||
- name: disable password auth
|
- name: disable password auth
|
||||||
file:
|
copy:
|
||||||
src: sshd/00-nopasswd.conf
|
src: sshd/00-nopasswd.conf
|
||||||
dest: /etc/ssh/ssh_config.d/00-altport.conf
|
dest: /etc/ssh/ssh_config.d/00-altport.conf
|
||||||
- name: change ssh port
|
- name: change ssh port
|
||||||
vars:
|
|
||||||
port: 1023
|
|
||||||
template:
|
template:
|
||||||
src: sshd/00-altport.conf
|
src: sshd/00-altport.conf
|
||||||
dest: /etc/ssh/ssh_config.d/00-altport.conf
|
dest: /etc/ssh/ssh_config.d/00-altport.conf
|
||||||
@@ -21,4 +20,5 @@
|
|||||||
dnf:
|
dnf:
|
||||||
state: present
|
state: present
|
||||||
name: policycoreutils-python-utils
|
name: policycoreutils-python-utils
|
||||||
- command: /usr/sbin/semanage port -a -t ssh_port_t -p tcp 1023
|
- name: give sshd access to alt port on selinux
|
||||||
|
command: "/usr/sbin/semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}"
|
||||||
@@ -1 +1 @@
|
|||||||
Port {{ port }}
|
Port {{ alt_ssh_port }}
|
||||||
Reference in new issue
Block a user