I currently have a SMB/CIFS network share which I have mounted under /var/inbound to receive files via SFTP. Here is what I have in my /etc/fstab:

//somename.file.core.windows.net/inbound /var/inbound cifs vers=3.0,username=somename,password=AccessKeyThatEndsWith==,dir_mode=0777,file_mode=0777

Now I want to have my users jailed at /var/inbound// and they would be uploading their files to /var/inbound//uploads.

Everything would work as expected if /var/inbound/ is just another directory in my Linux filesystem (I tested it). The issue starts when /var/inbound/ is in fact a mount of my SMB/CIFS network share. Users simply cannot connect using an SFTP Client (like FileZilla).

This all has to do with chown and chmod permission settings, and basically I need to be able to perform the following:

sudo chown testuser:sftponly /var/inbound/testuser/uploads
sudo chmod ug+rwX /var/inbound/testuser/uploads

The above works perfectly with a Linux filesystem but (by design) it would not work with a SMB/CIFS fileshare -- which is why I am experiencing errors. I understand that there could be some mapping that I could do in order to get the desired result, but I have no idea on how to do that.


It should be closer to what you want if you add some more options to the end of your fstab entry:

  • But what if I have additional users? Say testuser1, testuser2, etc? – pmdci Jul 13 '16 at 20:39
  • That would need multiple users to exist on your server too. Look at man mount.cifs. – meuh Jul 14 '16 at 14:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.