LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Proftpd: UserOwner and GroupOwner not working (can't chown) (https://www.linuxquestions.org/questions/linux-networking-3/proftpd-userowner-and-groupowner-not-working-cant-chown-614517/)

noisebleed 01-18-2008 08:16 AM

Proftpd: UserOwner and GroupOwner not working (can't chown)
 
Hi.

I have proftpd 1.3.1_rc2-rc3 up and running with an anonymous user tech (alias of ftp) with password.

My objective is to have all files uploaded by tech chown to apache:apache because the ftp account will be used to host web pages (html , php).

This is /etc/proftpd/proftpd.conf:
Code:

ServerName              "NG-001"
ServerType              standalone
DefaultServer          on
RequireValidShell      off
AuthPAM                on
AuthPAMConfig          ftp

UseReverseDNS off
IdentLookups off

Port                    21
PassivePorts            51000 51999

Umask                  022
MaxClients              20
MaxInstances            20
MaxLoginAttempts        3
RootLogin              off


Port                    21
PassivePorts            51000 51999

Umask                  022
MaxClients              20
MaxInstances            20
MaxLoginAttempts        3
RootLogin              off

ServerAdmin            support@noisebleed.pt

SystemLog              /var/log/proftpd.log
ServerLog              /var/log/proftpd.server.log
TransferLog            /var/log/proftpd.transfer.log

User                    ftp
Group                  ftp


DefaultRoot ~

<Directory />
        AllowOverwrite          on
</Directory>

<Anonymous /var/www/tech>
  User                  ftp
  Group                ftp
  UserAlias            tech ftp
  AnonRequirePassword  on
  RequireValidShell    off
  MaxClients            10
  DisplayLogin          "message.txt"
  DisplayChdir          .message

  GroupOwner    apache
  UserOwner    apache


  <Limit LOGIN>
    AllowUser  ftp
    DenyAll
  </Limit>

  # Hide all files owned by user 'root'
  HideUser                      root

  <Limit READ WRITE DIRS STOR CWD CDUP>
    AllowUser  ftp
    DenyAll
  </Limit>

</Anonymous>

When running proftpd with
Code:

# proftpd -nd9
this is showned:
Code:

noisebleed.localnet (10.17.1.19[10.17.1.19]) - chown(/Logo_Noisebleed_Oficial.png) as root failed: Operation not permitted
I have proftpd compiled with:
Code:

USE="mysql ncurses nls opensslcrypt pam radius ssl tcpd -acl -authfile -clamav -hardened -ifsession -ipv6 -ldap -noauthunix -postgres -rewrite (-selinux) -shaper -sitemisc -softquota -vroot -xinetd"
Does anyone got the UserOwner directive working properly?

comprookie2000 01-19-2008 06:38 PM

It may be easier to create the user tech and go that way or you may need something like;
Code:

<Anonymous ~ftp/sub/dir/>
  AnonRequirePassword on
  RequireValidShell off
  User ftp
  Group nobody

#  UserPassword ftp encpasswd
  UserPassword ftpuser1 encpasswd1
  UserPassword ftpuser2 encpasswd2
  (...)

  UserAlias ftpuser1 ftp
  UserAlias ftpuser2 ftp
  (...)
</Anonymous>

just a guess ...

noisebleed 01-21-2008 10:06 AM

Hi. Thanks for helping.

The user tech is just an alias.

When I use the ftp user as username the same error ("chown(/Logo_Noisebleed_Oficial.png) as root failed: Operation not permitted") occurs. Don't know why.

Should I blame the mask?
Code:

Umask                  022


All times are GMT -5. The time now is 02:41 PM.