FTP permission to group

Posted on 2007-10-20
Last Modified: 2013-12-16
I want to give to a group of user FTP access to one directory ( /var/www/test )
I have group and some users in it.
Server: Ubuntu Linux 7.04
Webmin: version 1.350
ProFTPd: version 1.30
But when I log in with username or with group name. I get to some empty dutectory ( I guess home directory of user).
But they need to get to  /var/www/test
How do I get it done?
Question by:APRESTOUS
    LVL 27

    Expert Comment


    If you  have a group, say 'testgroup':

    DefaultRoot /var/www/test testgroup

    it will work only if proftpd runs from 'root' user.

    Author Comment

    And what should I use as VirtualHost ?
    I access the server via IP adres.
    LVL 27

    Expert Comment

    Use your IP address instead of

    Author Comment

    Yes, I did as you said.
    I put the code into  /etc/proftpd/proftpd.conf  (right?)
    Restarted server.
    But I do not see any changes. I still come to the personal directory.
    LVL 27

    Expert Comment

    Please post here full proftpd config.

    Author Comment

    # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
    # To really apply changes reload proftpd after modifications.

    # Includes DSO modules
    Include /etc/proftpd/modules.conf

    # Set off to disable IPv6 support which is annoying on IPv4 only boxes.
    UseIPv6                        on

    ServerName                  "Debian"
    ServerType                  standalone
    DeferWelcome                  off

    MultilineRFC2228            on
    DefaultServer                  on
    ShowSymlinks                  on

    TimeoutNoTransfer            600
    TimeoutStalled                  600
    TimeoutIdle                  1200

    DisplayLogin                    welcome.msg
    DisplayFirstChdir               .message
    ListOptions                      "-l"

    DenyFilter                  \*.*/

    # Use this to jail all users in their homes
    # DefaultRoot                  ~

    # Users require a valid shell listed in /etc/shells to login.
    # Use this directive to release that constrain.
    # RequireValidShells            off

    # Port 21 is the standard FTP port.
    Port                        21

    # In some cases you have to specify passive ports range to by-pass
    # firewall limitations. Ephemeral ports can be used for that, but
    # feel free to use a more narrow range.
    # PassivePorts                  49152 65534

    # If your host was NATted, this option is useful in order to
    # allow passive tranfers to work. You have to use your public
    # address and opening the passive ports used on your firewall as well.
    # MasqueradeAddress  

    # To prevent DoS attacks, set the maximum number of child processes
    # to 30.  If you need to allow more than 30 concurrent connections
    # at once, simply increase this value.  Note that this ONLY works
    # in standalone mode, in inetd mode you should use an inetd server
    # that allows you to limit maximum number of processes per service
    # (such as xinetd)
    MaxInstances                  30

    # Set the user and group that the server normally runs at.
    User                        proftpd
    Group                        nogroup

    # Umask 022 is a good standard umask to prevent new files and dirs
    # (second parm) from being group and world writable.
    Umask                        022  022
    # Normally, we want files to be overwriteable.
    AllowOverwrite                  on

    # Uncomment this if you are using NIS or LDAP to retrieve passwords:
    # PersistentPasswd            off

    # Be warned: use of this directive impacts CPU average load!
    # Uncomment this if you like to see progress and transfer rate with ftpwho
    # in downloads. That is not needed for uploads rates.
    # UseSendFile                  off

    # Choose a SQL backend among MySQL or PostgreSQL.
    # Both modules are loaded in default configuration, so you have to specify the backend
    # or comment out the unused module in /etc/proftpd/modules.conf.
    # Use 'mysql' or 'postgres' as possible values.
    #<IfModule mod_sql.c>
    # SQLBackend                  mysql

    TransferLog /var/log/proftpd/xferlog
    SystemLog   /var/log/proftpd/proftpd.log

    <IfModule mod_tls.c>
    TLSEngine off

    <IfModule mod_quota.c>
    QuotaEngine on

    <IfModule mod_ratio.c>
    Ratios on

    # Delay engine reduces impact of the so-called Timing Attack described in
    # It is on by default.
    <IfModule mod_delay.c>
    DelayEngine on

    <IfModule mod_ctrls.c>
    ControlsEngine        on
    ControlsMaxClients    2
    ControlsLog           /var/log/proftpd/controls.log
    ControlsInterval      5
    ControlsSocket        /var/run/proftpd/proftpd.sock

    <IfModule mod_ctrls_admin.c>
    AdminControlsEngine on

    DefaultRoot /var/www/ www-data

    # A basic anonymous configuration, no upload directories.

    # <Anonymous ~ftp>
    #   User                        ftp
    #   Group                        nogroup
    #   # We want clients to be able to login with "anonymous" as well as "ftp"
    #   UserAlias                  anonymous ftp
    #   # Cosmetic changes, all files belongs to ftp user
    #   DirFakeUser      on ftp
    #   DirFakeGroup on ftp
    #   RequireValidShell            off
    #   # Limit the maximum number of anonymous logins
    #   MaxClients                  10
    #   # We want 'welcome.msg' displayed at login, and '.message' displayed
    #   # in each newly chdired directory.
    #   DisplayLogin                  welcome.msg
    #   DisplayFirstChdir            .message
    #   # Limit WRITE everywhere in the anonymous chroot
    #   <Directory *>
    #     <Limit WRITE>
    #       DenyAll
    #     </Limit>
    #   </Directory>
    #   # Uncomment this if you're brave.
    #   # <Directory incoming>
    #   #   # Umask 022 is a good standard umask to prevent new files and dirs
    #   #   # (second parm) from being group and world writable.
    #   #   Umask                        022  022
    #   #            <Limit READ WRITE>
    #   #            DenyAll
    #   #            </Limit>
    #   #            <Limit STOR>
    #   #            AllowAll
    #   #            </Limit>
    #   # </Directory>
    # </Anonymous>
    DefaultRoot /var/www
    GroupPassword www-data 2132121312
    LVL 27

    Expert Comment

    Please change your GroupPassword right now, before someone could use it.
    You don't need a VirtualHost section (remove it) since you have defined DefaultRoot in a global section. It doesnt' work may be because it runs not from root user:
    User                        proftpd
    Group                        nogroup

    But don't hurry to change it to root, it may be a security problem. Right now I don't have an advice, it's too late. So wait for others or for tomorrow.

    Author Comment

    Thank you .  
    I changed the password already before I posted it.  So it is the fake one.
    LVL 27

    Expert Comment

    Sorry for delay. I just installed proftpd for tests.

    I see no way to use the same username, that is capable to login with 2 different passwords (one is system and one is group) but to two different directories.
    Only one DefaultRoot is picked for any given user...

    But you may use an 'anonymous' section with it's own username and password and share that username/passwords with all group members, so they would be capable to login.

    My proftpd.conf:
    ServerName                  "Debian"
    ServerType                  standalone
    DeferWelcome                  off

    MultilineRFC2228            on
    DefaultServer                  on
    ShowSymlinks                  on

    TimeoutNoTransfer            600
    TimeoutStalled                  600
    TimeoutIdle                  1200

    DisplayLogin                    welcome.msg
    DisplayFirstChdir               .message
    ListOptions                      "-l"

    DenyFilter                  \*.*/
    Port                        21
    MaxInstances                  30
    User                        nobody
    Group                        nogroup
    Umask                        022  022
    AllowOverwrite                  on

    TransferLog /var/log/xferlog
    SystemLog   /var/log/proftpd.log

    DefaultRoot ~

    <Anonymous /tmp>
    User test
    Group ftpusers
    AnonRequirePassword on
    RequireValidShell off
    UserPassword test psitwOYgQD.K6
    UserAlias www-group test

    I added a system user 'test' with no system password (unable to login), that is used specially for group login and password 'nobody'.

    Now if we login as test:nobody or www-group:nobody, we come to /tmp directory, if we login as any other user, we come to user's home dir.


    Author Comment

    1) I add your section to the cinfig file
    2) I create Linux user tes with no login allowed
    3) ?
    Do I have to create group www-group ?
    Do I have to create group ftpusers ?
    LVL 27

    Accepted Solution

    I just created a user 'test' with no login allowed, no other user or group.
    Under this user id all others will be logged in system.

    Now you may login with either 'www-group' or 'test' username and a password that is in UserPassword option (which is encrypted with crypt() function).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now