MG

How to whitelist an IP address for SSH access

So long as your ok with using SSH and editing files using vim or nano, then allowing an IP address access to SSH is pretty simple…

Step 1

Login to the SSH and run this command:

nano /etc/ssh/sshd_config

Near the bottom of the file, find a list of IP address. Add the required IP to the end of this list, following the formatting of previous entries.

Close and save the file, by hitting ctrl+X, then Y

Step 2

Run this command:

nano /etc/security/access.conf

Near the bottom of the file, find a list of IP address. Add the required IP to the end of this list, following the formatting of previous entries.

Close and save the file, by hitting ctrl+X, then Y

Step 3

Run this command:

systemctl restart sshd
Back to blog

Leave a Reply

Your email address will not be published. Required fields are marked *