A Ubuntu 16 server is used as an SFTP-server. This server is located in an DMZ VLAN.
This server must be configured so that:
From the external internet only SFTP can be used to login but ssh cannot be used (to start a bash).
From the internal network, it must be possible to log in with both SFTP and SSH (to start a bash).
Two sshd
can be started for this, each with its own sshd_config
file and own port number.
How can a sshd_config
be configured in such a way that it is possible to
login with SFTP but not with ssh (to start a bash)?
Note: I am unable to fully test this at the moment - posted in the hope that it will be useful
This should be possible with a single sshd instance, by using a
Match
block at the bottom of the server'ssshd_config
file.Replace
192.168.1.0/24
with your own LAN CIDR address range.See also How can the Address condition in a Match conditional block in sshd_config be negated?