Skip to content

Commit c16ab19

Browse files
committed
Doc
1 parent ff9aaea commit c16ab19

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

doc/Documentation SellYourSaas - Master and Deployment Servers - EN.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ mylastnamefirstname ALL=(ALL) ALL
324324
# This allows to switch to admin or osu* with "sudo su - admin" or "sudo su - osu..."
325325
#mylastnamefirstname ALL=(ALL) /usr/bin/su - admin
326326
#mylastnamefirstname ALL=(ALL) /usr/bin/su - osu*
327+
#myadminunixlogin ALL=(ALL) /usr/bin/fail2ban-client
327328
---------------
328329

329330
This allows you to switch to *admin* or *osu...* without typing your password too:

scripts/ansible/user_create.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
- userroot is defined
8989
- userroot|length > 0
9090

91-
- name: Process line into file /etc/sudoers.d/{{login}} for su admin
91+
- name: Process line into file /etc/sudoers.d/{{login}} for sudo su - admin
9292
lineinfile:
9393
path: /etc/sudoers.d/{{ login }}
9494
line: "{{ login }} ALL=(ALL) /usr/bin/su - admin"
@@ -102,7 +102,7 @@
102102
- userpublickey|length > 0
103103
- userroot is not defined
104104

105-
- name: Process line into file /etc/sudoers.d/{{login}} for su osu
105+
- name: Process line into file /etc/sudoers.d/{{login}} for sudo su - osu
106106
lineinfile:
107107
path: /etc/sudoers.d/{{ login }}
108108
line: "{{ login }} ALL=(ALL) /usr/bin/su - osu*"
@@ -116,7 +116,21 @@
116116
- userpublickey|length > 0
117117
- userroot is not defined
118118

119-
- name: Remove deprecated line into file /etc/sudoers.d/{{login}} for su admin
119+
- name: Process line into file /etc/sudoers.d/{{login}} for sudo fail2ban
120+
lineinfile:
121+
path: /etc/sudoers.d/{{ login }}
122+
line: "{{ login }} ALL=(ALL) /usr/bin/fail2ban-client"
123+
owner: root
124+
group: root
125+
mode: '0440'
126+
create: yes
127+
state: present
128+
when:
129+
- userpublickey is defined
130+
- userpublickey|length > 0
131+
- userroot is not defined
132+
133+
- name: Remove deprecated line into file /etc/sudoers.d/{{login}} for sudo su - admin
120134
lineinfile:
121135
path: /etc/sudoers.d/{{ login }}
122136
line: "{{ login }} ALL=(ALL) NOPASSWD:/bin/su - admin"
@@ -129,7 +143,7 @@
129143
- userpublickey is defined
130144
- userpublickey|length > 0
131145

132-
- name: Remove deprecated line into file /etc/sudoers.d/{{login}} for su osu
146+
- name: Remove deprecated line into file /etc/sudoers.d/{{login}} for sudo su - osu
133147
lineinfile:
134148
path: /etc/sudoers.d/{{ login }}
135149
line: "{{ login }} ALL=(ALL) NOPASSWD:/bin/su - osu*"

0 commit comments

Comments
 (0)