Skip to content

Instantly share code, notes, and snippets.

@DonerKebab
Last active November 26, 2018 07:00
Show Gist options
  • Save DonerKebab/051505edc3ee6cde5ec09ce32d699a9f to your computer and use it in GitHub Desktop.
Save DonerKebab/051505edc3ee6cde5ec09ce32d699a9f to your computer and use it in GitHub Desktop.
sudo groupadd ftpaccess
sudo nano /etc/ssh/sshd_config
Add these lines to the bottom:
Match Group ftpaccess
ChrootDirectory /data/%u
ForceCommand internal-sftp
sudo service ssh restart
sudo userdel -r giffgaff
sudo useradd -m giffgaff -g ftpaccess -s /usr/sbin/nologin
sudo passwd giffgaff
sudo chown root /home/giffgaff
sudo mkdir /home/giffgaff/leads
sudo chown giffgaff:ftpaccess /home/giffgaff/leads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment