Compare commits
4
Commits
999595a699
...
161ce95e7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
161ce95e7e
|
||
|
|
36cbf9861f
|
||
|
|
322a14a882
|
||
|
|
7ce23b6fa4
|
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:
|
include_role:
|
||||||
src: sshd/00-nopasswd.conf
|
name: kevinnlsamuel.galaxy.sshd.disablepasswd
|
||||||
dest: /etc/ssh/ssh_config.d/00-altport.conf
|
|
||||||
- name: change ssh port
|
- name: change ssh port
|
||||||
vars:
|
when: false
|
||||||
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,8 @@
|
|||||||
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
|
||||||
|
register: result_change_to_alt_port
|
||||||
|
ignore_errors: true
|
||||||
|
changed_when: "'already defined' not in result_change_to_alt_port.stdout"
|
||||||
|
command: semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}
|
||||||
@@ -1 +1 @@
|
|||||||
Port {{ port }}
|
Port {{ alt_ssh_port }}
|
||||||
File renamed without changes.
@@ -0,0 +1,6 @@
|
|||||||
|
galaxy_info:
|
||||||
|
author: kevinnlsamuel
|
||||||
|
description: sayin hello
|
||||||
|
dependencies:
|
||||||
|
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||||
|
# if you add dependencies to this list.
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
- name: disable password auth
|
||||||
|
copy:
|
||||||
|
src: 00-nopasswd.conf
|
||||||
|
dest: /etc/ssh/sshd_config.d/00-nopasswd.conf
|
||||||
|
- name: restart sshd
|
||||||
|
service:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
||||||
Reference in new issue
Block a user