User can't creat folders through ftp session

Status
Not open for further replies.

A.A.

Cadet
Joined
Sep 12, 2014
Messages
2
Hi,

I upgraded FreeNAS to version 9.2.1.7
Enabled FTP service with chroot options enabled.
Created user test and logged in through ftp.
I can create files, download files, delete files and directories, but I can't create directories.
When I try to do it I receive:
"Command: MKD Test_dir
Response: 550 Test_dir: Operation not permitted"

In shell I can see that user is owner of his FTP folder. And I see that permissions are 777 for this folder.

Bur I still receive this error and can't create directories.
I can create directories if I logged in as user in shell or through CIFS sharing.
Only in FTP session I have this problem.

This is my proftpd config:
"
ServerName "my.domain FTP Server"
ServerType standalone
DefaultServer on
#Default Address my.domain.local
#UseIPv6 on
Port 21
User nobody
Group nogroup
Umask 000 000
SyslogFacility ftp
MultilineRFC2228 off
DisplayLogin /var/run/proftpd/proftpd.motd
DeferWelcome off
TimeoutIdle 600
TimeoutLogin 300
TimeoutNoTransfer 300
TimeoutStalled 3600
MaxInstances none
MaxClients 50

MaxLoginAttempts 1
DefaultTransferMode ascii
#AllowForeignAddress off

IdentLookups off
UseReverseDNS off


<Limit LOGIN>
AllowAll
</Limit>

<Global>
RequireValidShell off
DefaultRoot ~ !wheel
# RootLogin on
AllowOverwrite on
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
TimesGMT off
</Global>

<IfModule mod_ban.c>
BanEngine off
BanControlsACLs all allow group wheel
BanLog /var/log/proftpd/ban.log
BanMessage Host %a has been banned
# -m "mod_ban/rule"
# -v "concat(' BanOnEvent ',event,' ',occurrence,'/',timeinterval,' ',expire)" -n
# -b
BanTable /var/run/proftpd/ban.tab
</IfModule>


<IfModule mod_delay.c>
DelayEngine on
DelayTable "/var/run/proftpd/proftpd.delay"
</IfModule>

<IfModule mod_wrap.c>
TCPAccessFiles /etc/hosts.allow /etc/hosts.allow
TCPAccessSyslogLevels info warn
TCPServiceName ftpd
</ifModule>"

Any ideas?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Are you writing to the same share via FTP and CIFS? If so your permissions are probably messed up. You should create a dataset for FTP shares and a separate dataset for CIFS shares. Don't mix them as the results may be like sticking cats and dogs in a bag and expecting them to have kids.
 

A.A.

Cadet
Joined
Sep 12, 2014
Messages
2
Thank's andros
The problem is fixed by created new dataset for FTP.

Thank you.
 

fzitelli

Cadet
Joined
Dec 30, 2014
Messages
5
Andors, If i need to write/read to the same share via FTP and CIFS what can i do?. I need to read files from a server (windows) uploaded vía ftp

thnks
 

holo

Cadet
Joined
Oct 27, 2015
Messages
1
Hello Everyone,

I have the same issue and i use different datasets for CIFS shares and FTP.

My ftp config look identical with the one described in the first post.

The ftp user is owner and has right to read/write/modify for user/group

When connecting on ftp, i get error 550 permission denied when i try to create folders. I can upload files without problem.

What could be the issue ? i triple checked and tried multiple ways to configure and no luck, i certainly missing something but what.

Most likely sounds like permissions issue, but the user is owner and has all the rghts assigned on that specific dataset ( ftp user home folder )

thanks in advance for any input.
 
Last edited:

Frenchy

Cadet
Joined
Oct 31, 2015
Messages
4
Hi all,

I see this was not solved then (apart from setting different shares which is not an option for me). I need to access the same share both with CIFS and FTP. The reason is I want to be able to FXP between shares to avoid transferring huge files between shares twice to my computer and back over wifi. Is there a way to fix this (not sure I'm making myself clear though)?

Thanks!
 

mykolaq

Explorer
Joined
Apr 10, 2014
Messages
61
Hi all,

I see this was not solved then (apart from setting different shares which is not an option for me). I need to access the same share both with CIFS and FTP. The reason is I want to be able to FXP between shares to avoid transferring huge files between shares twice to my computer and back over wifi. Is there a way to fix this (not sure I'm making myself clear though)?

Thanks!
I have the same problem too. did you fixed it?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I have the same problem too. did you fixed it?

It's not really a problem in itself. Samba (SMB) shares in FreeNAS use ACLs (windows permissions type). Traditional Unix file systems use posix mode bits (Unix permissions type). There are some nasty edge-cases when using chmod (the utility for manipulating posix mode bits) on directories that have ACLs which can result in users losing write access to their SMB shares. For this reason, SMB shares are configured in FreeNAS to prevent users from using the chmod command. So the FTP server saying
Code:
"Command: MKD Test_dir
Response: 550 Test_dir: Operation not permitted"

Is expected behavior.

If you're allowing users FTP access to a samba share, you need to have the FTP server deny chmod operations so that clients don't throw errors. An example of how to do this is through limits
Code:
  <Limit SITE_CHMOD>
	DenyAll
  </Limit>

The above can be added as an "Auxiliary parameter" under Services -> FTP.

Note that simultaneous FTP and SMB access to the same dataset in large multi-user environments is not a great idea. The FTP server does not understand SMB oplocks / leases, which can result in data corruption.

Edit: Hah, I just necro-ed a thread. I blame @DrKK because his link set me here, and since I didn't have coffee yet, I thought to myself "self, this question needs to be answered!"
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

chris crude

Patron
Joined
Oct 13, 2016
Messages
210
Your inner voice calls you "self"? That's weird.
Whats weird is that my inner voice sounds like PeeWee Herman. Annoying sometimes, but it helps distinguish the running dialog in my head.
 
Status
Not open for further replies.
Top