How do I limit access to a ufw app/service (not port) by IP address?

By flickerfly

I know how to allow only a specific IP address into a port, but I can’t find the syntax to do this by service. I kinda like having the services so I can group and read my rules more easily.

How do I allow an IP address to a app like ssh, or in this case mongodb?

I tried the following:

sudo ufw allow Mongodb from 50.60.70.21
sudo ufw allow from 50.60.70.21 to Mongodb

I read through the man page, bit it doesn’t seem to address apps much more than anywhere else on the Internet.

Source:: http://askubuntu.com/questions/870726/how-do-i-limit-access-to-a-ufw-app-service-not-port-by-ip-address


Leave a Reply