M
M
masonchickk2020-11-07 17:29:02
Computer networks
masonchickk, 2020-11-07 17:29:02

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

3 answer(s)
R
rPman, 2020-11-07
@rPman

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

M
masonchickk, 2020-11-07
@masonchickk

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 question

Ask a Question

731 491 924 answers to any question