Skip to content
Snippets Groups Projects
ubuntu-shellinabox.yaml 637 B
Newer Older
Laurent Modolo's avatar
Laurent Modolo committed
- hosts: all
  tasks:

  - name: Update the system
    apt:
      upgrade: dist

  - name: Install requirements
    apt:
      name: 
        - openssl
        - shellinabox
      state: latest

  - name: Configure shell in a box 
    shell: sed -i 's|SHELLINABOX_PORT=4200|SHELLINABOX_PORT=443|' /etc/default/shellinabox

  - name: Configure network
    shell: iptables -t filter -A INPUT -p tcp --dport 443 -j ACCEPT && iptables -t filter -A OUTPUT -p tcp --dport 443 -j ACCEPT && iptables-save

  - name: Restart services
    systemd:
      name: "{{ item }}" 
      enabled: yes
      state: restarted
    loop:
      - shellinabox