0

I have an Ubuntu 18.04 system running and want to access this system using SFTP. I have a lot of users, that shall access /var/ftp/data/%u, additionally, I need a user f_sftp, that can access and read /var/ftp/ including all sub directories.

Current status:

  • All folders and subfolders are in ownership root:root with chmod 755.
  • In this status I can read all data, but I cannot upload anything.
  • If I change the ownership; e.g. to root:f_user (root is member of f_user), I can't connect with any of my accounts (even though they are member of f_user).
  • If I change the mode, e.g. to 777, I cannot connect via SFTP due to wrong mode or ownership.

Can someone tell me, what is the correct configuration here so that SFTP works and my users can partly read and partly read&write?

Thanks :)

  • sounds like /var/ftp/data/%u should be %u:f_user and chmod 2750 and the individual %u's should not be a member of f_user – hanshenrik Apr 29 at 18:58
  • Are you using the ssh chroot feature? – Kenster Apr 29 at 19:01
  • @Kennster: Not sure, if you mean specifically that, but I setup the home directories of my users for SFTP like that: Subsystem sftp internal-sftp Match Group f_user ChrootDirectory /var/ftp/data/%u ForceCommand internal-sftp AllowTcpForwarding no Match Group f_sftp ChrootDirectory /var/ftp ForceCommand internal-sftp AllowTcpForwarding no – Human_BetaRelease Apr 30 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.