Skip to content

Instantly share code, notes, and snippets.

@tushev
Last active June 7, 2022 08:50
Show Gist options
  • Save tushev/549825627d0694228dd9d509860999c0 to your computer and use it in GitHub Desktop.
Save tushev/549825627d0694228dd9d509860999c0 to your computer and use it in GitHub Desktop.
# This is a part of /etc/ssh/sshd_config
Match User XXXXXXXXXXX
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
# ForceCommand /bin/false
# GatewayPorts no
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
# !!! /home/%u/chroot MUST be owned by root:
# chown root:root /home/XXXXXXXXXXX
# chmod 701 /home/XXXXXXXXXXX
# mkdir /home/XXXXXXXXXXX/chroot
# chown root:root /home/XXXXXXXXXXX/chroot
# chmod 705 /home/XXXXXXXXXXX/chroot
# !!! SOLVE NAME RESOLUTION ISSUE ( https://askubuntu.com/a/469213 // https://serverfault.com/a/958928 ):
# mkdir /home/XXXXXXXXXXX/chroot/etc
# echo 'nameserver 8.8.4.4' > /home/XXXXXXXXXXX/chroot/etc/resolv.conf
ChrootDirectory %h/chroot
ForceCommand internal-sftp
HostbasedAuthentication no
RhostsRSAAuthentication no
Banner none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment