P
P
Pavel2018-04-12 15:59:40
linux
Pavel, 2018-04-12 15:59:40

How to restrict ssh access to specific users?

Hello! There is a server on debian 9 with two network cards (for the local network and for the Internet).
From the local network, everyone should have access via ssh. But 1-2 certain users should be able to connect via the Internet, and close access for the rest.
How to organize this? Regular means of ssh, as I understand it, can not be done.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2018-04-12
@html_profi

Raise two separate sshds, pointing them to different configuration files
/usr/sbin/sshd -f /etc/ssh/sshd_config_local
/usr/sbin/sshd -f /etc/ssh/sshd_config_external
Write the interface in ListenAddress in each config - you can do both sshd run on the same port 22, and no one will suspect anything.
And there, through AllowUsers, specify who on which sshd is allowed to enter.

I
Ivan, 2018-04-12
@LiguidCool

Raise your VPN...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question