View previous topic :: View next topic |
Author |
Message |
mulebreath n00b
Joined: 08 Feb 2003 Posts: 24
|
Posted: Sat May 15, 2004 12:42 am Post subject: Virtual hosting user access |
|
|
If all the virtual account information is contained in a database, could someone recommend a method to allow user access to upload web pages. I just know to set up a user account for each domain and use ftp/sftp, but is there a more elegant way where I wouldn't have to add any user accounts and could tap into a username/password from mysql? |
|
Back to top |
|
|
arcane81 n00b
Joined: 18 Mar 2004 Posts: 19
|
Posted: Mon May 17, 2004 8:55 pm Post subject: FTP |
|
|
I would suggest using Proftp. You will have 1 system user which your ProFTP will run as. Then all the auth will happen in mysql. It allows for bandwidth throttling and you can specify which directory they can access. It is very easy to install. make-"mysql" => emerge proftpd => modify proftpd.conf and then you are done.....sort of. if you decide this is what you want to so i will post my config and db scema.
this solution will allow you to create users though php, perl ...anything that has a mysql interface.
good luck. _________________ <a href="https://forums.gentoo.org/viewtopic.php?p=1019489#1019489">*LIK*</a> |
|
Back to top |
|
|
mulebreath n00b
Joined: 08 Feb 2003 Posts: 24
|
Posted: Sun May 23, 2004 1:55 am Post subject: |
|
|
Thanks for your help.
It seems like an excellent ftp server, no doubt, but isn't ftp inherently insecure (transmitting passwords over the wire in clear text) no matter how good the product? |
|
Back to top |
|
|
Spice n00b
Joined: 14 Mar 2004 Posts: 28 Location: Germany
|
Posted: Sun Jun 06, 2004 5:42 pm Post subject: Re: FTP |
|
|
arcane81 wrote: | if you decide this is what you want to so i will post my config and db scema. |
Hi arcane81,
I'm very interested in your proftpd.conf and your mysql-db-schema as an example.
Thanks a lot in advance...
Spice |
|
Back to top |
|
|
tweibley n00b
Joined: 11 Nov 2003 Posts: 12
|
Posted: Sun Jun 06, 2004 10:10 pm Post subject: |
|
|
I'm about 1 day from being finished with a Pureftp / MySQL / Php (& Apache) setup for administering ftp accounts (can be either local or virtual). In the future I could also add in module support for the current Gentoo Virtual Mail Hosting stuff. Please let me know of any interest... _________________ --Taylor < >< |
|
Back to top |
|
|
arcane81 n00b
Joined: 18 Mar 2004 Posts: 19
|
Posted: Fri Jun 11, 2004 4:16 pm Post subject: |
|
|
sorry for the delay
Code: | # and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
ServerName "ASFTP Arcane Software"
ServerType standalone
DefaultServer on
Port 21
Umask 022
MaxInstances 30
User root
Group root
SQLAuthTypes Plaintext
SQLAuthenticate users* groups*
SQLConnectInfo proftpd@localhost root
SQLUserInfo users username passwd NULL NULL homedir NULL
SQLGroupInfo groups groupname id username
SQLUserWhereClause "valid = 1"
SQLDefaultGID 48
SQLDefaultUID 48
SQLHomedirOnDemand off
RequireValidShell off
SQLLog PASS updatelogin
SQLNamedQuery updatelogin UPDATE "count=count+1, lastlogin=NOW() WHERE username = '%u'" users
### Log trafic (STOR, RETR commands)
SQLLog RETR,STOR logtrafic
SQLNamedQuery logtrafic FREEFORM "INSERT INTO history (username, filename, transfertype, transfersize, transferhost, transfertime, transferdate) VALUES('%u', '%F', '%m', %b, '%a', '%T', NOW())"
### Log user error events (ERR_* commands)
SQLLog ERR_* logevents
SQLNamedQuery logevents FREEFORM "INSERT INTO userevents (username, eventtype, description, eventdate) VALUES ('%u', '%m', '%r', NOW())"
#TransferRate APPE,STOU,STOR 1 class admin
<Global>
DisplayLogin welcome.msg
TransferRate APPE,STOR 2.5 group !noth
TransferRate RETR 2.5 group !noth
TimeoutIdle 0
</Global>
<Directory /*>
AllowOverwrite on
<Limit WRITE>
DenyAll
AllowGroup admin
</Limit>
</Directory>
DefaultRoot ~
AllowOverwrite off
RootLogin off |
|
|
Back to top |
|
|
arcane81 n00b
Joined: 18 Mar 2004 Posts: 19
|
Posted: Fri Jun 11, 2004 4:18 pm Post subject: SQL |
|
|
Code: |
CREATE TABLE `groups` (
`id` int(11) NOT NULL auto_increment,
`groupname` varchar(15) NOT NULL default '',
`username` varchar(15) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=60 ;
CREATE TABLE `history` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(15) default NULL,
`filename` varchar(100) default NULL,
`transfertype` varchar(10) default NULL,
`transfersize` int(11) default NULL,
`transferhost` varchar(30) default NULL,
`transfertime` varchar(20) default NULL,
`transferdate` datetime default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=8579 ;
CREATE TABLE `listgroups` (
`id` int(11) NOT NULL auto_increment,
`groupname` varchar(15) NOT NULL default '',
`description` varchar(255) default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=25 ;
CREATE TABLE `userevents` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(15) default NULL,
`eventtype` varchar(10) default NULL,
`description` varchar(255) default NULL,
`eventdate` datetime default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=27961 ;
CREATE TABLE `users` (
`username` varchar(15) NOT NULL default '',
`passwd` varchar(15) NOT NULL default '',
`fullname` varchar(60) default NULL,
`valid` smallint(6) default '0',
`count` int(11) default '0',
`lastlogin` datetime default NULL,
`homedir` varchar(100) default NULL,
PRIMARY KEY (`username`),
KEY `username` (`username`)
) TYPE=MyISAM;
|
_________________ <a href="https://forums.gentoo.org/viewtopic.php?p=1019489#1019489">*LIK*</a> |
|
Back to top |
|
|
arcane81 n00b
Joined: 18 Mar 2004 Posts: 19
|
Posted: Fri Jun 11, 2004 4:23 pm Post subject: Here is the data that will get you up. |
|
|
INSERT INTO `users` VALUES ('wms', 'password', 'wms', 1, 3354, NOW(), '/home/');
INSERT INTO `groups` VALUES (11, 'admin', 'wms');
INSERT INTO `groups` VALUES (8, 'noth', 'wms');
The group noth will be unthrottled while the group admin is throttled down to 1 quick burst of around 500k then it becomes throttled to a very low 2.5k you can change that in the conf file.
Hope this helps. _________________ <a href="https://forums.gentoo.org/viewtopic.php?p=1019489#1019489">*LIK*</a> |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|