Skip to content

Instantly share code, notes, and snippets.

@visuve
Last active September 8, 2021 07:35
Show Gist options
  • Select an option

  • Save visuve/ddebd92efda4eda0ee89cbc5d9a7ecf8 to your computer and use it in GitHub Desktop.

Select an option

Save visuve/ddebd92efda4eda0ee89cbc5d9a7ecf8 to your computer and use it in GitHub Desktop.
Glances & UFW configuration guide

1. Configure glances

1.1 Install glances

  • apt install glances

1.2 Start glances on boot

  • Remove old initd startup config
    • rm /etc/init.d/glances
  • Create new systemd config
    • touch /etc/systemd/system/glancesweb.service
    • Paste this in it:
[Unit]
Description=GlancesWeb
Requires=systemd-networkd.service
After=systemd-networkd.service

[Timer]
OnBootSec=10

[Service]
ExecStart=/usr/bin/glances -w

[Install]
WantedBy=multi-user.target
  • Enable glancesweb.service on boot
    • systemctl enable glancesweb.service

2. Configure firewall

2.1 Install UFW firewall

  • apt install ufw

2.2 Configure UFW (iptables underneath)

  • ufw default deny incoming
  • ufw default allow outgoing
  • ufw allow ssh
  • ufw allow 61208/tcp
  • ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment