?
Solved

FTP permission to group

Posted on 2007-10-20
12
Medium Priority
?
661 Views
Last Modified: 2013-12-16
Hello,
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?
0
Comment
Question by:APRESTOUS
  • 6
  • 5
11 Comments
 
LVL 27

Expert Comment

by:Nopius
ID: 20117402
http://www.proftpd.org/localsite/Userguide/linked/x751.html
http://www.proftpd.org/localsite/Userguide/linked/chroot.html#AEN715

If you  have a group, say 'testgroup':

<VirtualHost myhost.mynet.foo>
DefaultRoot /var/www/test testgroup
</VirtualHost>

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

Author Comment

by:APRESTOUS
ID: 20117434
And what should I use as VirtualHost ?
I access the server via IP adres.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 20117558
Use your IP address instead of myhost.mynet.foo
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:APRESTOUS
ID: 20117576
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.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 20117640
Please post here full proftpd config.
0
 

Author Comment

by:APRESTOUS
ID: 20117652
#
# /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            1.2.3.4

# 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
#</IfModule>

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

<IfModule mod_tls.c>
TLSEngine off
</IfModule>

<IfModule mod_quota.c>
QuotaEngine on
</IfModule>

<IfModule mod_ratio.c>
Ratios on
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

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

<IfModule mod_ctrls_admin.c>
AdminControlsEngine on
</IfModule>

<VirtualHost 5.28.162.130>
DefaultRoot /var/www/ www-data
</VirtualHost>

# 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>
<Global>
DefaultRoot /var/www
GroupPassword www-data 2132121312
</Global>
0
 
LVL 27

Expert Comment

by:Nopius
ID: 20117879
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.
0
 

Author Comment

by:APRESTOUS
ID: 20117954
Hello,
Thank you .  
I changed the password already before I posted it.  So it is the fake one.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 20191686
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:
---[cut]---
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

<Global>
DefaultRoot ~
</Global>

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

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.

0
 

Author Comment

by:APRESTOUS
ID: 20202324
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 ?
0
 
LVL 27

Accepted Solution

by:
Nopius earned 2000 total points
ID: 20205228
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).
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 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