I'm looking to allow SSH access via an IP address range that does not fit neatly into a subnet. Just as an example, thru

I only want a group of so many IPs allowed to SSH to an Ubuntu 16.04 box. This obviously does fit neatly in a subnet, so using for 192.168.10.* will allow IPs outside the 60-80 group.

Other than listing each IP address individually, how can a group be allowed? I tried using and that did not work. I tried it in /etc/hosts/allow and in /etc/ssh/sshd_config.



Instead of you "might" try, but from what I've been reading, unfortunately I think you are going to have to list each ip. "*@ *@ *@ *@" etc. It could be worse, that's "only" 20 entries, with copy paste it should old take a couple minutes.


Tried different combinations of that, with spaces before and/or after the dash, full IP or just the last subnet like in my original post. That did not work.

I had to list them all individually to make it work.

Your Answer

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

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