vpn
This commit is contained in:
14
roles/xray-vps-setup/tasks/ssh.yml
Normal file
14
roles/xray-vps-setup/tasks/ssh.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
- name: Change SSH port
|
||||
shell:
|
||||
cmd: grep -r Port /etc/ssh -l | xargs -n 1 sed -i -e "/Port /c\Port {{ SSH_PORT }}"
|
||||
- name: Disable password login
|
||||
shell:
|
||||
cmd: grep -r PasswordAuthentication /etc/ssh -l | xargs -n 1 sed -i -e "/PasswordAuthentication /c\PasswordAuthentication no"
|
||||
- name: Disable root login
|
||||
shell:
|
||||
cmd: grep -r PermitRootLogin /etc/ssh -l | xargs -n 1 sed -i -e "/PermitRootLogin /c\PermitRootLogin no"
|
||||
- name: Restart ssh
|
||||
service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
Reference in New Issue
Block a user