0

Im setting up a web server on 18.04 and I want to be able to block all ip's except my public ip from accessing ssh (22) on the UFW. Thanks for your help!

0

This should do the trick assuming your public ip is 1.2.3.4:

sudo ufw allow from 1.2.3.4/32 to any port 22

Please refer to man ufw for more info.

I hope this helps.

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.