I'm using a Match
block in OpenSSH's /etc/ssh/sshd_config
(on debian) to restrict some users to SFTP:
# my stuff
Match group sftponly
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp -u 0002
ChrootDirectory %h
As you can see, I use a #my stuff
comment in custom config files to easily distinguish default configurations from those I made (and I put those at the end of the config files).
Now I wanted to append the directive UseDNS no
to the configuration (to speed up logins) but OpenSSH said Directive 'UseDNS' is not allowed within a Match block
.
Now I was wondering whether there is a syntax like End Match
to end those match blocks?
UseDNS
directive (which didn't work before). Accepting this as the new answer. -- Newer OpenSSH versions apparently won't even start with an emptyMatch
: https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-April/032456.html – mreithub Aug 17 '16 at 19:48PasswordAuthentication
is misleading. I'm writing it that way too, however the config parser does not care about indentation. All it looks for is match blocks. Once it's seen one, the global config is over, and all it cares about are match blocks. – Marki Dec 24 '20 at 12:47