Ubuntu – Restrict SSH Access to Specific IP for User

Securityssh

My /etc/ssh/sshd_config file has a line like:

AllowUsers jim@11.22.33.456

If I want to allow jim to use another IP addresses, how do I specify it?

Does it take the form of a comma separated list? Or, do add a similar line like

AllowUsers jim@new-ip-address

?

Best Answer

I would do

AllowUsers jim@11.22.33.56 jim@141.212.133.36

OR

AllowUsers jim@11.22.33.*

should work, that is if you are internal and he has a dynamic ip.