Answer the question
In order to leave comments, you need to log in
Is it possible to configure the SHH server so that the connection to a specific port is limited by keys?
Good afternoon!
There is a SHH server behind NAT. Two ports 22 and 1111 are registered in sshd_config. The port from external 12345 to standard 22 is redirected to SHH from outside. Authentication from the external network is carried out through a pair of keys with a passphrase. It is necessary to organize access to the SHH server on port 1111 from the local network using a key pair without a passphrase. Is it possible to restrict the connection to each of the ports depending on the public key?
Answer the question
In order to leave comments, you need to log in
Different users! In sshd_config, set the requirements for each, regardless of the port.
If you need the same user in both use cases, write autologin under the desired user in .bashrc
Yes, I need under the same user. Running 2 daemons really looks easier to me personally, because as a non-experienced user, I'm not familiar with .bashrc. Then, as far as I understand, under the user in the home folder, I create authorized_keys1 authorized_keys2, and specify the paths and ports in the corresponding sshd_config1 sshd_config2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question