How do you whitelist an IP address with just one line command?

I've been searching how to whitelist a IP address (ex. 123.123.321.1) with Ubuntu 12.04. But everyone seems to give long elaborate answers. Is there just 1 simple command to whitelist an IP address? I want to whitelist an IP address so it can connect via SSH port 22. Also would this solution work with other linux flavors like centos?

1 Answer

sudo ufw allow in from 123.123.321.1 to any port 22 

CentOS doesn't use ufw. You'll have to use iptables.

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like