I'm trying to restrict an SSH-tunnel user.
# sudo cat /home/user/.ssh/config
Banner none
ChrootDirectory /home/%u
PasswordAuthentication no
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
ForceCommand /bin/false
However, none of these seem to have any effect.
When I prepend /home/user/.ssh/authorized_keys
with no-pty,no-agent-forwarding,no-X11-forwarding,command="/bin/false"
it works, but I'd like to also include these directives into permanent configuration.
Is it possible to restrict a user this way without updating /etc/ssh/sshd_config
?
UPDATE I know about Match User
and Match Group
; the point is to have this in a user-specific config.
/etc/sshd_config
, if possible. – ᴍᴇʜᴏᴠ Aug 24 '18 at 13:47Include
- I thought about it, and even tried it, unfortunately it doesn't work. I'll post some more info as an answer. – ᴍᴇʜᴏᴠ Aug 24 '18 at 18:52