Sftp chroot configuration

From wikieduonline
Revision as of 11:35, 13 May 2020 by Welcome (talk | contribs)
Jump to navigation Jump to search


1) First step

#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp


2) Second step and create a user section at the end of the file (ssh can die respawning if placed after Subsystem line):

Match User john
   ChrootDirectory %h
   ForceCommand internal-sftp
   AllowTCPForwarding no
   X11Forwarding no


With double Match rule

Match User john LocalPort 2222 
   ChrootDirectory %h
   ForceCommand internal-sftp
   AllowTCPForwarding no
   X11Forwarding no


scp error

 protocol error: mtime.sec not present

sshd -T

'Match LocalPort' in configuration but 'lport' not in connection test specification.


See also

Advertising: