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 Answers 2

3

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.

0
2

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .