-
Create folder to chroot
mkdir /opt/sftp
-
Change ownership
chown root:root /opt/sftp
-
Change mode
chmod go-w /opt/sftp
-
Change sshd config
/etc/ssh/sshd_config
Subsystem sftp internal-sftp Match User <sftp user> ChrootDirectory /opt/sftp X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp
-
Restart sshd
service sshd restart
-
Login
sftp <sftp-user>@<host>
Connected to <host>. sftp>
Created
February 13, 2016 22:11
-
-
Save tarunbhardwaj/3a448301b05621c4edc5 to your computer and use it in GitHub Desktop.
Setup sftp with chroot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment