documentation:sftp_jail
Differences
This shows you the differences between two versions of the page.
| documentation:sftp_jail [2020/02/01 12:35] – external edit 127.0.0.1 | documentation:sftp_jail [2020/02/02 15:15] (current) – removed lucid | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======Create Secure SFTP Server with User Jails====== | ||
| - | ===== Basics ===== | ||
| - | Step 1 : Install OpenSSH package if not installed | ||
| - | |||
| - | < | ||
| - | |||
| - | Step 2 : Create separate group for SFTP users. | ||
| - | |||
| - | < | ||
| - | |||
| - | Step 3 : Edit / | ||
| - | **Subsystem sftp / | ||
| - | |||
| - | and add these lines to the end of the file. | ||
| - | |||
| - | < | ||
| - | ... | ||
| - | Match User sammyfiles | ||
| - | ForceCommand internal-sftp | ||
| - | PasswordAuthentication yes | ||
| - | ChrootDirectory /var/sftp | ||
| - | PermitTunnel no | ||
| - | AllowAgentForwarding no | ||
| - | AllowTcpForwarding no | ||
| - | X11Forwarding no | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | Step 4 : Restart sshd service. | ||
| - | |||
| - | < | ||
| - | |||
| - | Step 5 : Add user with sftpaccess group and create password. | ||
| - | |||
| - | < | ||
| - | |||
| - | Step 6 : Modify home directory permission. | ||
| - | |||
| - | < | ||
| - | |||
| - | Step 7 : Create a directory inside home for upload and modify permission with group. | ||
| - | |||
| - | < | ||
| - | sudo chown < | ||
| - | </ | ||
| - | ===== Multiple Users ===== | ||
| - | |||
| - | To create multiple users with their individual jails, simply create separate users and their induvidual sftpaccess-< | ||
| - | |||
| - | < | ||
| - | |||
| - | And this needs to be reflected while creating the user as well. | ||
| - | |||
| - | < | ||
| - | |||
| - | Lastly simply add the share to the ssh config file. | ||
| - | < | ||
| - | Match group sftpaccess-< | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | </ | ||
documentation/sftp_jail.1580560512.txt.gz · Last modified: 2021/06/18 16:36 (external edit)