Sftp

From Bitpost wiki
Revision as of 14:25, 18 October 2017 by M (talk | contribs) (Created page with "Sometimes crappy old sftp is required. Always prefer scp for copying and web hosting on bitpost.com for sharing. * Ensure you installed openssh-server (of course you did) *...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Sometimes crappy old sftp is required. Always prefer scp for copying and web hosting on bitpost.com for sharing.

  • Ensure you installed openssh-server (of course you did)
  • Set up an ftp group
sudo addgroup ftpusergroup
  • Edit /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match group ftpusergroup
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
  • Restart sshd service
sudo service ssh restart
  • Add user with correct permissions
sudo adduser lemmeftp --ingroup ftpusergroup --shell /usr/sbin/nologin
# set the password
# if the user exists, to change pw: sudo -u lemmeftp passwd
sudo chown root:root /home/lemmeftp
sudo mkdir /home/lemmeftp/files
sudo chown lemmeftp:ftpusergroup /home/lemmeftp/files

Reference 1, and 2