Patel, Viren
2016-11-28 18:07:38 UTC
Hello. I have configured ProFTPD 1.3.5/mod_sftp to allow users to sftp to the server using SSH keys. Everything works as expected except for creating folders. The users can login, upload files using put, and can also delete existing files *and* folders. However the users cannot create a new folder using mkdir or via put –r. I have checked folder permissions, uid matchings, experimented with Limit settings - nothing allows a user to create a folder. The error message received is “Couldn't create directory: Permission denied”. Following is my proftpd.conf file (minus comments/blank lines):
ServerName"ProFTPD Default Installation"
ServerTypestandalone
DefaultServeroff
Port21
UseIPv6off
Umask022
MaxInstances30
Userftp
Groupftp
AllowOverwriteon
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Limit RETR>
DenyAll
</Limit>
UseReverseDNSoff
ServerLog/opt/proftpd/var/log/server.log
SystemLog/opt/proftpd/var/log/system.log
TransferLog/opt/proftpd/var/log/transfer.log
TraceLog/opt/proftpd/var/log/sftp_trace.log
Tracesftp:20 sftp:2222
<VirtualHost ip.add.ress>
SFTPEngine on
Port 2222
SFTPLog /opt/proftpd/var/log/sftp.log
ExtendedLog /opt/proftpd/var/log/sftp_extended.log
TransferLog /opt/proftpd/var/log/sftp_transfer.log
SFTPDisplayBanner /opt/proftpd/etc/proftpd_sftp_banner.txt
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPAuthorizedUserKeys file:/opt/proftpd/etc/sftp/authorized_keys/%u
SFTPCompression delayed
SFTPOptions IgnoreSFTPUploadPerms IgnoreSCPUploadPerms
MultilineRFC2228 on
DefaultRoot ~
RequireValidShell off
Umask 027
MaxClientsPerHost 2
MaxClientsPerUser 2
MaxHostsPerUser2
<Limit LOGIN>
AllowUsertestuser
DenyAll
</limit>
</VirtualHost>
Running the server with –d 10 option the following messages are in the system log file when mkdir command is issued:
dispatching PRE_CMD command 'MKDIR /ppp' to mod_core
dispatching PRE_CMD command 'MKDIR /ppp' to mod_core
dispatching PRE_CMD command 'MKD /ppp' to mod_core
dispatching PRE_CMD command 'MKD /ppp' to mod_core
in dir_check_full()
in dir_check_full()
chmod(/.dstXXXrb5R2u) failed
dispatching LOG_CMD_ERR command 'MKD /ppp' to mod_log
dispatching LOG_CMD_ERR command 'MKDIR /ppp' to mod_log
scrubbing scoreboard
ROOT PRIVS at scoreboard.c
RELINQUISH PRIVS at scoreboard.c
ROOT PRIVS at scoreboard.c
RELINQUISH PRIVS at scoreboard.c
finished scrubbing scoreboard
It seems chmod is failing. However disabling the SITE_CHMOD limit in the above config has no effect.
The following entries are in the trace log file:
2016-11-28 13:02:46,046 [23435] <sftp:6>: received MKDIR (14) SFTP request (request ID 2, channel ID 0)
2016-11-28 13:02:46,046 [23435] <sftp:7>: SFTPOption 'IgnoreSFTPUploadPerms' configured, ignoring perms sent by client
2016-11-28 13:02:46,047 [23435] <sftp:7>: received request: MKDIR /ppp type=unknown;
2016-11-28 13:02:46,049 [23435] <sftp:8>: sending response: STATUS 2 'No such file' ('No such file or directory' [2])
Any suggestions would be appreciated.
Thanks.
________________________________
This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.
If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
ServerName"ProFTPD Default Installation"
ServerTypestandalone
DefaultServeroff
Port21
UseIPv6off
Umask022
MaxInstances30
Userftp
Groupftp
AllowOverwriteon
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Limit RETR>
DenyAll
</Limit>
UseReverseDNSoff
ServerLog/opt/proftpd/var/log/server.log
SystemLog/opt/proftpd/var/log/system.log
TransferLog/opt/proftpd/var/log/transfer.log
TraceLog/opt/proftpd/var/log/sftp_trace.log
Tracesftp:20 sftp:2222
<VirtualHost ip.add.ress>
SFTPEngine on
Port 2222
SFTPLog /opt/proftpd/var/log/sftp.log
ExtendedLog /opt/proftpd/var/log/sftp_extended.log
TransferLog /opt/proftpd/var/log/sftp_transfer.log
SFTPDisplayBanner /opt/proftpd/etc/proftpd_sftp_banner.txt
SFTPHostKey /etc/ssh/ssh_host_rsa_key
SFTPAuthorizedUserKeys file:/opt/proftpd/etc/sftp/authorized_keys/%u
SFTPCompression delayed
SFTPOptions IgnoreSFTPUploadPerms IgnoreSCPUploadPerms
MultilineRFC2228 on
DefaultRoot ~
RequireValidShell off
Umask 027
MaxClientsPerHost 2
MaxClientsPerUser 2
MaxHostsPerUser2
<Limit LOGIN>
AllowUsertestuser
DenyAll
</limit>
</VirtualHost>
Running the server with –d 10 option the following messages are in the system log file when mkdir command is issued:
dispatching PRE_CMD command 'MKDIR /ppp' to mod_core
dispatching PRE_CMD command 'MKDIR /ppp' to mod_core
dispatching PRE_CMD command 'MKD /ppp' to mod_core
dispatching PRE_CMD command 'MKD /ppp' to mod_core
in dir_check_full()
in dir_check_full()
chmod(/.dstXXXrb5R2u) failed
dispatching LOG_CMD_ERR command 'MKD /ppp' to mod_log
dispatching LOG_CMD_ERR command 'MKDIR /ppp' to mod_log
scrubbing scoreboard
ROOT PRIVS at scoreboard.c
RELINQUISH PRIVS at scoreboard.c
ROOT PRIVS at scoreboard.c
RELINQUISH PRIVS at scoreboard.c
finished scrubbing scoreboard
It seems chmod is failing. However disabling the SITE_CHMOD limit in the above config has no effect.
The following entries are in the trace log file:
2016-11-28 13:02:46,046 [23435] <sftp:6>: received MKDIR (14) SFTP request (request ID 2, channel ID 0)
2016-11-28 13:02:46,046 [23435] <sftp:7>: SFTPOption 'IgnoreSFTPUploadPerms' configured, ignoring perms sent by client
2016-11-28 13:02:46,047 [23435] <sftp:7>: received request: MKDIR /ppp type=unknown;
2016-11-28 13:02:46,049 [23435] <sftp:8>: sending response: STATUS 2 'No such file' ('No such file or directory' [2])
Any suggestions would be appreciated.
Thanks.
________________________________
This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.
If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).