Skip to content 99% OFF 🎉 Anniversary Sale 99% OFF Shared Hosting Use Code HURRYUP Claim Offer 99% OFF Hosting
99% OFF Hosting — Code HURRYUP
Products
AI Website Builder New VPS Hosting Cloud Servers Web Hosting cPanel Hosting Dedicated Servers Domains
Company
About Documentation Support Center Contact Get Started Call +91 75795 45488
Login
Hosting Panel — cPanel & Billing Console Panel — VPS Management
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