Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Virtual hosting user access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mulebreath
n00b
n00b


Joined: 08 Feb 2003
Posts: 24

PostPosted: Sat May 15, 2004 12:42 am    Post subject: Virtual hosting user access Reply with quote

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
View user's profile Send private message
arcane81
n00b
n00b


Joined: 18 Mar 2004
Posts: 19

PostPosted: Mon May 17, 2004 8:55 pm    Post subject: FTP Reply with quote

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
View user's profile Send private message
mulebreath
n00b
n00b


Joined: 08 Feb 2003
Posts: 24

PostPosted: Sun May 23, 2004 1:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Spice
n00b
n00b


Joined: 14 Mar 2004
Posts: 28
Location: Germany

PostPosted: Sun Jun 06, 2004 5:42 pm    Post subject: Re: FTP Reply with quote

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
View user's profile Send private message
tweibley
n00b
n00b


Joined: 11 Nov 2003
Posts: 12

PostPosted: Sun Jun 06, 2004 10:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
arcane81
n00b
n00b


Joined: 18 Mar 2004
Posts: 19

PostPosted: Fri Jun 11, 2004 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
arcane81
n00b
n00b


Joined: 18 Mar 2004
Posts: 19

PostPosted: Fri Jun 11, 2004 4:18 pm    Post subject: SQL Reply with quote

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
View user's profile Send private message
arcane81
n00b
n00b


Joined: 18 Mar 2004
Posts: 19

PostPosted: Fri Jun 11, 2004 4:23 pm    Post subject: Here is the data that will get you up. Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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