ftp: can create folder but not access

Status
Not open for further replies.

timypcr

Dabbler
Joined
May 31, 2016
Messages
10
I’m having trouble setting up an ftp account. I create a dataset dedicated for FTP, a user “ftpuser1” and a home directory for that user (chroot enabled)


FreeNAS-9.10-STABLE (see screen shots)


I open FileZilla and connect using the FreeNAS internal IP (no NAT or anything like that)

I am able to login no problem and also create a directory, but I am not able to access any folder I create, when trying to do so “Failed to retrieve directory listing”


FileZilla log


Status: Connecting to 192.168.4.239:21...

Status: Connection established, waiting for welcome message...

Status: Insecure server, it does not support FTP over TLS.

Status: Logged in

Status: Retrieving directory listing...

Status: Directory listing of "/" successful

Status: Creating directory '/test'...

Status: Retrieving directory listing of "/test"...

Command: CWD test

Response: 550 test: No such file or directory

Error: Failed to retrieve directory listing



(I’ve tried this in an alternative ftp client such as CarotDAV but the results are the same)



Any suggestions would be greatly appreciated.

tim
 

Attachments

  • ftp-settings.png
    ftp-settings.png
    24.2 KB · Views: 418
  • userpart1.png
    userpart1.png
    20.1 KB · Views: 421
  • userpart2.png
    userpart2.png
    9.1 KB · Views: 427
Last edited:

timypcr

Dabbler
Joined
May 31, 2016
Messages
10
Yes ssh works without issue, i was planing on setting up ftp/tls to secure the encryption and ran into the issue I posted about. I suppose for outside access sftp vs ftps will serve the same purpose in regards to encrypting the traffic, just want to know whats wrong with my ftp setup as I am still learning freenas.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I understand the need to know, I just see no point in investing effort in solving issues with FTP when SFTP is better in every way.
 

timypcr

Dabbler
Joined
May 31, 2016
Messages
10
So what's the best way to chroot ssh users with sftp-only access and restrict them to there home folder while still allowing administrators to login over ssh and still use a shell? Should non-admin user accounts be running in a jail?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Who owns the /mnt/ypcr/ftp directory and what are its permissions? Looks like you are missing read permissions on that directory for your user.
 

timypcr

Dabbler
Joined
May 31, 2016
Messages
10
/mnt/ypcr/ftp is owned by root (screen shot attached) could this be why sub folder access is not working after creation? I wanted to have multiple users locked into there home folder, so would I need to create an ftp-only group and assign it full permissions? I have tried doing this on the command line using the ftpuser1 group that was created when the ftpuser1 account was setup.

chown -R ftpuser1:ftpuser1 /mnt/ypcr/ftp/ftpuser1

what would you suggest to get each account working only within it's own home folder SweetAndLo.

tim
 

Attachments

  • ftp-perms.png
    ftp-perms.png
    18.4 KB · Views: 459

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Create a dataset for ftp users. Create a nested dataset within the ftp dataset for each user. Set their home folder as that nested dataset. Set them as the owner. That will lock them in the dataset so they can't wander around the rest of the system.
 
Last edited:

timypcr

Dabbler
Joined
May 31, 2016
Messages
10
I've also tried creating a group ftp-only (full access) and adding ftpuser1 to it, same issue. diedrichg I'll give your suggestion a go next. thanks eveyone
 
Last edited:

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
This works. Give it a try.

User settings
8bcceecc33215c797ceeff35397a6137.jpg


FTP main dataset owner /mnt/dvgmar/guests
f48116f6656cba004e7af37cfafbda79.jpg


Nested dataset for the FTP user /mnt/dvgmar/guests/maurice
9e83240104ac5104a8731e598a16112c.jpg
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
When you first login over ftp you are in the directory that you specify as the ftp root under the ftp service settings. I think you are just in the wrong directory when you are doing stuff. I think for some of your tests you are in the root and others you are in the users directory. The screen shot where you showed that /mnt/ycpr/ftp is set for 777 permissions will allow you to ftp in and run a mkdir and cd into that directory. If you say it doesn't work that is because you are in the wrong directory.

But you probably don't want all users to use the same directory do you? So you should change the ftp data set back to root:wheel and 755 then create user directories for everyone with permissions of 700. This will prevent people from writing to root of the ftp and only allow them to write to their directory and not see what other people have in their directories.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Status
Not open for further replies.
Top