File sharing with SMB/CIFS and SFTP

Status
Not open for further replies.

Vero O

Cadet
Joined
Feb 12, 2015
Messages
9
Hi, I need to share my users home directories stored in my NAS. They can access them remotely using SFTP (I chroot their directories according this http://olddoc.freenas.org/index.php/SSH) and create files and directories. But if they try to access them using smb with smbclient, they can read only the home dir, but they cannot create files or directories getting this error: NT_STATUS_ACCESS_DENIED making remote directory (or file)
Is there a specific configuration for the directories and datasets for properly share ?
Thanks in advance.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yep. This is because ftp uses unix permissions while SMB/CIFS uses ACLs. So if you touch files or directories with ftp, you can screw up the ACLs (and vice versa).

As we've said several times, you can't use ftp to copy files into/out of SMB and expect things to work. You have to use FTP or SMB for a given location, not both.

I'm somewhat disappointed in this myself as I liked to have a folder that I could sftp into at will, throw some files on, and log out if I wasn't at home and when I got home I'd sort the files. But that doesn't really work well without doing a lot of advanced settings beforehand to make it all work. It's not something I recommend for people that don't already understand permissions, and based on the question you don't appear to be the kind of advanced user that is capable of figuring it out enough to make it 1/2 kinda-sorta-work.

So stick to one dataset for SMB and one dataset for FTP.
 
Joined
Oct 2, 2014
Messages
925
Yep. This is because ftp uses unix permissions while SMB/CIFS uses ACLs. So if you touch files or directories with ftp, you can screw up the ACLs (and vice versa).

As we've said several times, you can't use ftp to copy files into/out of SMB and expect things to work. You have to use FTP or SMB for a given location, not both.

I'm somewhat disappointed in this myself as I liked to have a folder that I could sftp into at will, throw some files on, and log out if I wasn't at home and when I got home I'd sort the files. But that doesn't really work well without doing a lot of advanced settings beforehand to make it all work. It's not something I recommend for people that don't already understand permissions, and based on the question you don't appear to be the kind of advanced user that is capable of figuring it out enough to make it 1/2 kinda-sorta-work.

So stick to one dataset for SMB and one dataset for FTP.
Not to threadjack, but by this logic i shouldnt use FreeNAS ftp connection to dump files onto my SMB shares then huh...crap
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Not to threadjack, but by this logic i shouldnt use FreeNAS ftp connection to dump files onto my SMB shares then huh...crap

Unfortunately not. :(

That's exactly what I used to use it for. :(
 

Vero O

Cadet
Joined
Feb 12, 2015
Messages
9
And as you saw, I am making a question, and you did not give me one. You are an advanced user and if you know how to set the correct permissions for make this work, you could share it with the community. I am sure you are generous ;)
 
Last edited:
Joined
Oct 2, 2014
Messages
925
Is there any alternative?
Only alternative i saw in Cyberjocks post was use 1 dataset exclusively for FTP and another for SMB. Or....do what i am doing which is running Filezilla FTP server on my one windows server, and then mapping my FreeNAS drive to it. Granted it has to go through a network path to get the files uploaded/downloaded but its working....and i dont think ill run into permission issues.
 
Status
Not open for further replies.
Top