File sharing with SMB/CIFS and SFTP

Status
Not open for further replies.

Vero O

Cadet
Joined
Feb 12, 2015
Messages
9
<div class="bbWrapper">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 <a href="http://olddoc.freenas.org/index.php/SSH" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://olddoc.freenas.org/index.php/SSH</a>) 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)<br /> Is there a specific configuration for the directories and datasets for properly share ?<br /> Thanks in advance.</div>
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
<div class="bbWrapper">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).<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> So stick to one dataset for SMB and one dataset for FTP.</div>
 
Joined
Oct 2, 2014
Messages
925
<div class="bbWrapper"><blockquote data-attributes="member: 22572" data-quote="cyberjock" data-source="post: 196213" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-title"> <a href="/community/goto/post?id=196213" class="bbCodeBlock-sourceJump" rel="nofollow" data-xf-click="attribution" data-content-selector="#post-196213">cyberjock said:</a> </div> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> 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).<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> So stick to one dataset for SMB and one dataset for FTP. </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote>Not to threadjack, but by this logic i shouldnt use FreeNAS ftp connection to dump files onto my SMB shares then huh...crap</div>
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
<div class="bbWrapper"><blockquote data-attributes="member: 43778" data-quote="Darren Myers" data-source="post: 196256" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-title"> <a href="/community/goto/post?id=196256" class="bbCodeBlock-sourceJump" rel="nofollow" data-xf-click="attribution" data-content-selector="#post-196256">Darren Myers said:</a> </div> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> Not to threadjack, but by this logic i shouldnt use FreeNAS ftp connection to dump files onto my SMB shares then huh...crap </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote><br /> Unfortunately not. :(<br /> <br /> That's exactly what I used to use it for. :(</div>
 

Vero O

Cadet
Joined
Feb 12, 2015
Messages
9
<div class="bbWrapper">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 ;)</div>
 
Last edited:

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
<div class="bbWrapper">He basically said, &quot;what you're trying to do won't work.&quot;</div>
 
Joined
Oct 2, 2014
Messages
925
<div class="bbWrapper"><blockquote data-attributes="member: 47291" data-quote="Vero O" data-source="post: 196434" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-title"> <a href="/community/goto/post?id=196434" class="bbCodeBlock-sourceJump" rel="nofollow" data-xf-click="attribution" data-content-selector="#post-196434">Vero O said:</a> </div> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> Is there any alternative? </div> <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div> </div> </blockquote>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.</div>
 
Status
Not open for further replies.
Top