APRESTOUS
asked on
FTP permission to group
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?
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?
ASKER
And what should I use as VirtualHost ?
I access the server via IP adres.
I access the server via IP adres.
Use your IP address instead of myhost.mynet.foo
ASKER
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.
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.
Please post here full proftpd config.
ASKER
#
# /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.l og
<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.s ock
</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>
# /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.l
<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.
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.s
</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>
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.
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.
ASKER
Hello,
Thank you .
I changed the password already before I posted it. So it is the fake one.
Thank you .
I changed the password already before I posted it. So it is the fake one.
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.
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.
ASKER
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 ?
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 ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.