1

ufw commands

I'm interested in setting up some basic security on an Ubuntu 16.04 VPS that I'm working on. I'm reading through these articles:

I'm reading the section about ufw now. I'm going to be connecting from variable IP addresses via ssh. Given this requirement, what should I set the first line in the screenshot to, to make sure I retain access?

2

I'm a bit confused about the title, but to answer your question

I'm going to be connecting from variable ip addresses via ssh. Given this requirement what should I set the first line in the screenshot to, to make sure I retain access?

sudo ufw allow 22 or even sudo ufw allow OpenSSH will open up port 22 to the world.

I didn't look at your links, but I hope they also suggest using keys instead of password login.

1

I would recommend installing DenyHosts and Fail2Ban as well as using UFW. What you can do is go into DenyHosts and whitelist a range of IPs. For instance I have 192.168.1.* White listed so any connection from local is allowed. I also have my work IP white listed as well.

DenyHosts can be installed with sudo apt-get install denyhosts. Then go into sudo nano /etc/denyhosts.conf and configure your SSH.

You will need to go into /var/lib/denyhosts and either create or add to the allowed-hosts file. http://www.sgvulcan.com/2010/03/26/whitelist-a-host-when-using-denyhosts/

See also this for more in depth security see the following link: https://www.thefanclub.co.za/how-to/how-secure-ubuntu-1604-lts-server-part-1-basics

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.