0

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

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 192.168.10.0/24 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 192.168.10.60-80 and that did not work. I tried it in /etc/hosts/allow and in /etc/ssh/sshd_config.

Thanks.

0

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

0

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.