Skip to content
Products
AI Website Builder New VPS Hosting Cloud Servers Web Hosting Dedicated Servers Domains
Company
About Documentation Support Center Contact Get Started Login Client Area
ALL SYSTEMS OPERATIONAL
Blog

Diag half2 Please Ignore Delete Me

Getwebup 1 min read

t

        line: 'PasswordAuthentication no'
      notify: restart sshd

    - name: Disable root SSH login
      lineinfile:
        path: /etc/ssh/sshd_config
        regexp: '^#?PermitRootLogin'
        line: 'PermitRootLogin no'
      notify: restart sshd

    - name: Install ufw and fail2ban
      apt:
        name: ['ufw', 'fail2ban']
        state: present

    - name: Allow SSH, HTTP, HTTPS through ufw
      ufw:
        rule: allow
        port: "{{ item }}"
      loop: ['22', '80', '443']

    - name: Enable ufw
      ufw:
        state: enabled
        policy: deny

  handlers:
    - name: restart sshd
      service:
        name: sshd
        state: restarted

Keep reading

Chat with Support