-
-
Save lyovkin/8555162921b0cfd94abf25d28a9839b1 to your computer and use it in GitHub Desktop.
Create a user and restrict him to his home dir (sftp)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo groupadd sftpusers | |
sudo adduser importer | |
sudo chown root:root /home/importer | |
sudo usermod importer -g sftpusers | |
sudo mkdir /home/importer/data | |
sudo chown -R importer:sftpusers /home/importer/data | |
------------------------- | |
sftp access configuration | |
------------------------- | |
PasswordAuthentication yes | |
#Subsystem sftp /usr/lib/openssh/sftp-server | |
Subsystem sftp internal-sftp | |
Match Group sftpusers | |
ChrootDirectory %h | |
ForceCommand internal-sftp | |
PermitTunnel no | |
AllowAgentForwarding no | |
AllowTcpForwarding no | |
X11Forwarding no | |
sudo service ssh restart | |
----------------------- | |
mount folder (optional) | |
---------------------- | |
mount --bind /home/importer/data /path/data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment