Skip to content

Instantly share code, notes, and snippets.

@cornflourblue
Last active July 12, 2020 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cornflourblue/d7d1b42552287ad4afa3f579597e54d5 to your computer and use it in GitHub Desktop.
Save cornflourblue/d7d1b42552287ad4afa3f579597e54d5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "
----------------------
UFW (FIREWALL)
----------------------
"
# allow ssh connections through firewall
sudo ufw allow OpenSSH
# allow http & https through firewall
sudo ufw allow 'Nginx Full'
# enable firewall
sudo ufw --force enable
@ShawnWon
Copy link

image
Hi, Jason, thank you so much for your brilliant tutorial artical and video. I followed your tutorial to depoly a demo page,(Node + local MongoDb), everything works fine except the page will not be able to get data from mongodb once I enabled ufw. I had allowed 27017 and reloaded the ufw, (ufw status as in screenshot). The page works well once disabled ufw. Any idea where is the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment