Quantcast
Viewing all articles
Browse latest Browse all 4527

How to configure sshd_config to allow HostKeyAlgorithms=+ssh-rsa for a specific IP and restrict all other IPs on Ubuntu22.04 Server?

I am running an Ubuntu 22.04 server and need to configure sshd_config to achieve the following:

Allow the use of HostKeyAlgorithms=+ssh-rsa for a specific IP address. ex. x.x.x.6 , x.x.x.100, x.x.x.150Restrict or deny the use of HostKeyAlgorithms=+ssh-rsa for all other IP addresses.I have tried adding the following lines to my sshd_config file, but it doesn't seem to work as

Match Address x.x.x.6    HostKeyAlgorithms +ssh-rsaMatch Address x.x.x.100    HostKeyAlgorithms +ssh-rsaMatch Address x.x.x.150    HostKeyAlgorithms +ssh-rsa

What is the correct way to configure sshd_config to meet these requirements? Are there any additional steps or configurations I need to consider? Any help or guidance would be greatly appreciated!

Note:
Ubuntu Version: 22.04
OpenSSH Version: OpenSSH_8.9p1


Viewing all articles
Browse latest Browse all 4527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>