Re: [PHP] PHP AS an FTP server

2009-02-19 Thread paragasu
i successfully configure vsftp login using pam-mysql last time.

http://pam-mysql.sourceforge.net/
http://www.linux.com/feature/125789

user can login to ftp server using the same password on web..

hope it help

On 2/18/09, Michael Kubler  wrote:
> Yeah, I don't want local user access (SSH, their own entries in passwd,
> etc..). Too much work to ensure they all have the correct file
> permissions, etc..
> I think I'll just skip the PHP bit and use a proper FTP server. I've
> configured them a few times, but all the examples I found only had
> Anonymous FTP login, or MySQL (which is what I want), but the server
> wouldn't work with the MySQL plugin.
> Looks like I'll have to compile from source... joy.
>
> Thanks for all the replies though.
>
> Michael Kubler
> *G*rey *P*hoenix *P*roductions 
>
>
>
> Thodoris wrote:
>>
>> The local users part was about ssh-sftp access Ash not ftp.
>>
>> IMO when you add local users you add extra risks to your system than
>> simple ftp (non-local) users may not cause. Of course if you secure
>> your system carefully everything will work fine but I would avoid that
>> and there are many security issues that here is not the place to discuss.
>>
>> Of course if this fits your needs I have no objections.
>> --
>> Thodoris
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP AS an FTP server

2009-02-18 Thread Michael Kubler
Yeah, I don't want local user access (SSH, their own entries in passwd, 
etc..). Too much work to ensure they all have the correct file 
permissions, etc..
I think I'll just skip the PHP bit and use a proper FTP server. I've 
configured them a few times, but all the examples I found only had 
Anonymous FTP login, or MySQL (which is what I want), but the server 
wouldn't work with the MySQL plugin.

Looks like I'll have to compile from source... joy.

Thanks for all the replies though.

Michael Kubler
*G*rey *P*hoenix *P*roductions 



Thodoris wrote:


The local users part was about ssh-sftp access Ash not ftp.

IMO when you add local users you add extra risks to your system than 
simple ftp (non-local) users may not cause. Of course if you secure 
your system carefully everything will work fine but I would avoid that 
and there are many security issues that here is not the place to discuss.


Of course if this fits your needs I have no objections.
--
Thodoris


Re: [PHP] PHP AS an FTP server

2009-02-18 Thread Thodoris



On Tue, 2009-02-17 at 18:54 +0200, Thodoris wrote:
  

Hi,
This is probably a bit stupid, but I've been having issues getting any 
of the good FTP servers running on my Ubuntu 6.06 (LTS) box.
I've tried Pro-FTP, Pure-FTP, and briefly installed some others, but 
the versions available for my distro don't seem to support MySQL (or 
I'm simply doing something wrong).
  
AFAIK in most distros the ftp servers come without mysql (or database) 
authentication support. If this is what is happening in your case you 
need to compile the ftp server from source adding a configuration time 
option to enable the database support.



Anyway, I had the thought that the FTP server won't be used much, as I 
mainly use SSH, however I need to be able to give other people access, 
which is why I'm wondering if there are any PHP scripts that can be 
used AS an FTP server. That is, I'd setup Apache to accept on the 
standard FTP port(s), and get it to point everything to a PHP script, 
which I could then use to pull user/pass details each of which would 
have their own directories, allowing each user to access a sym-link to 
their domain(s) log file, website directory, and anything else.
  
In case you have ssh enabled you may use the sftp subsystem that openssh 
supports if it fits your needs. It's more secure than plain ftp but you 
still have to add local user accounts which is a bad idea imo.


You may use PHP to upload files using the http (and not the ftp) 
protocol by making a project that authenticates the user provides him 
the ability to upload, delete and download files using forms.


There has to be something already written that implements such a 
procedure in case you don't want to code this by yourself. You may 
google to find whatever fits your needs.



Has someone already got a script that does this (at least accepting 
FTP connections), or is this a crazy idea that's just not possible?
Should I just compile the latest version of some FTP server, and try 
and configure that to do what I want instead?
  
I suggest that since you need ftp access it would be much better if you 
could configure an ftp server instead of writing something on your own.
The vsftp daemon is a good solution to your problem written including 
advanced security features but I don't know  if it supports mysql 
authentication. On the other hand pro-ftpd does support modular 
authentication (mysql, ldap etc) if you compile the proper module.




Thanks.
  

--
Thodoris




I used vsftp for several FTP systems at work, and bar a few problems
(errors on my part!) they work just fine. I've even got PHP talking to
various Bash scripts to manage users and permissions for the FTP, and,
touch wood, everything works well.

I wouldn't really agree that allowing local users to FTP in is a bad
idea. I'm using just that method for my systems. The users, etc are only
ever created through a web interface, which forces certain rules on
usernames, which as far as I see it, is the only problem. As long as the
vsftpd.conf file is configured correctly and securely, the whole thing
will remain pretty tight.


Ash
www.ashleysheridan.co.uk

  


The local users part was about ssh-sftp access Ash not ftp.

IMO when you add local users you add extra risks to your system than 
simple ftp (non-local) users may not cause. Of course if you secure your 
system carefully everything will work fine but I would avoid that and 
there are many security issues that here is not the place to discuss.


Of course if this fits your needs I have no objections.

--
Thodoris



Re: [PHP] PHP AS an FTP server

2009-02-17 Thread rwlists
I have used PureFTPd for quite some time and have had nothing but success
with features and security.  I use MySQL soon to migrate to PostgreSQL for
the authentication.  It supports quota, bandwidth throttling etc

Randall Wiggins


On Wed, 18 Feb 2009 04:37:04 +0800, "j's php general"
 wrote:
> On Wed, Feb 18, 2009 at 4:24 AM, Ashley Sheridan
>  wrote:
> 
>> I used vsftp for several FTP systems at work, and bar a few problems
>> (errors on my part!) they work just fine. I've even got PHP talking to
>> various Bash scripts to manage users and permissions for the FTP, and,
>> touch wood, everything works well.
>>
>> I wouldn't really agree that allowing local users to FTP in is a bad
>> idea. I'm using just that method for my systems. The users, etc are only
>> ever created through a web interface, which forces certain rules on
>> usernames, which as far as I see it, is the only problem. As long as the
>> vsftpd.conf file is configured correctly and securely, the whole thing
>> will remain pretty tight.
>>
>>
>> Ash
>> www.ashleysheridan.co.uk
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
> A couple months back we were able to configure ProFTPd with MySQL
> support to allow our forum users to login and upload files. Although
> users login using credentials from MySQL they are somewhat chrooted to
> a single user with very limited capabilities and no shell of course.
> 
> This opens up the possibility of working with the users from PHP.
> 
> With a bit of creativity this link can help you get started
> http://www.howtoforge.com/proftpd_mysql_virtual_hosting
> 
> -
> http://www.lampadmins.com
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP AS an FTP server

2009-02-17 Thread j's php general
On Wed, Feb 18, 2009 at 4:24 AM, Ashley Sheridan
 wrote:

> I used vsftp for several FTP systems at work, and bar a few problems
> (errors on my part!) they work just fine. I've even got PHP talking to
> various Bash scripts to manage users and permissions for the FTP, and,
> touch wood, everything works well.
>
> I wouldn't really agree that allowing local users to FTP in is a bad
> idea. I'm using just that method for my systems. The users, etc are only
> ever created through a web interface, which forces certain rules on
> usernames, which as far as I see it, is the only problem. As long as the
> vsftpd.conf file is configured correctly and securely, the whole thing
> will remain pretty tight.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

A couple months back we were able to configure ProFTPd with MySQL
support to allow our forum users to login and upload files. Although
users login using credentials from MySQL they are somewhat chrooted to
a single user with very limited capabilities and no shell of course.

This opens up the possibility of working with the users from PHP.

With a bit of creativity this link can help you get started
http://www.howtoforge.com/proftpd_mysql_virtual_hosting

-
http://www.lampadmins.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP AS an FTP server

2009-02-17 Thread Ashley Sheridan
On Tue, 2009-02-17 at 18:54 +0200, Thodoris wrote:
> > Hi,
> > This is probably a bit stupid, but I've been having issues getting any 
> > of the good FTP servers running on my Ubuntu 6.06 (LTS) box.
> > I've tried Pro-FTP, Pure-FTP, and briefly installed some others, but 
> > the versions available for my distro don't seem to support MySQL (or 
> > I'm simply doing something wrong).
> 
> AFAIK in most distros the ftp servers come without mysql (or database) 
> authentication support. If this is what is happening in your case you 
> need to compile the ftp server from source adding a configuration time 
> option to enable the database support.
> 
> >
> > Anyway, I had the thought that the FTP server won't be used much, as I 
> > mainly use SSH, however I need to be able to give other people access, 
> > which is why I'm wondering if there are any PHP scripts that can be 
> > used AS an FTP server. That is, I'd setup Apache to accept on the 
> > standard FTP port(s), and get it to point everything to a PHP script, 
> > which I could then use to pull user/pass details each of which would 
> > have their own directories, allowing each user to access a sym-link to 
> > their domain(s) log file, website directory, and anything else.
> 
> In case you have ssh enabled you may use the sftp subsystem that openssh 
> supports if it fits your needs. It's more secure than plain ftp but you 
> still have to add local user accounts which is a bad idea imo.
> 
> You may use PHP to upload files using the http (and not the ftp) 
> protocol by making a project that authenticates the user provides him 
> the ability to upload, delete and download files using forms.
> 
> There has to be something already written that implements such a 
> procedure in case you don't want to code this by yourself. You may 
> google to find whatever fits your needs.
> 
> >
> > Has someone already got a script that does this (at least accepting 
> > FTP connections), or is this a crazy idea that's just not possible?
> > Should I just compile the latest version of some FTP server, and try 
> > and configure that to do what I want instead?
> 
> I suggest that since you need ftp access it would be much better if you 
> could configure an ftp server instead of writing something on your own.
> The vsftp daemon is a good solution to your problem written including 
> advanced security features but I don't know  if it supports mysql 
> authentication. On the other hand pro-ftpd does support modular 
> authentication (mysql, ldap etc) if you compile the proper module.
> 
> >
> > Thanks.
> 
> -- 
> Thodoris
> 
> 
I used vsftp for several FTP systems at work, and bar a few problems
(errors on my part!) they work just fine. I've even got PHP talking to
various Bash scripts to manage users and permissions for the FTP, and,
touch wood, everything works well.

I wouldn't really agree that allowing local users to FTP in is a bad
idea. I'm using just that method for my systems. The users, etc are only
ever created through a web interface, which forces certain rules on
usernames, which as far as I see it, is the only problem. As long as the
vsftpd.conf file is configured correctly and securely, the whole thing
will remain pretty tight.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP AS an FTP server

2009-02-17 Thread APseudoUtopia
On Tue, Feb 17, 2009 at 10:53 AM, Michael Kubler  wrote:
> Hi,
> This is probably a bit stupid, but I've been having issues getting any of
> the good FTP servers running on my Ubuntu 6.06 (LTS) box.
> I've tried Pro-FTP, Pure-FTP, and briefly installed some others, but the
> versions available for my distro don't seem to support MySQL (or I'm simply
> doing something wrong).
>
> Anyway, I had the thought that the FTP server won't be used much, as I
> mainly use SSH, however I need to be able to give other people access, which
> is why I'm wondering if there are any PHP scripts that can be used AS an FTP
> server. That is, I'd setup Apache to accept on the standard FTP port(s), and
> get it to point everything to a PHP script, which I could then use to pull
> user/pass details each of which would have their own directories, allowing
> each user to access a sym-link to their domain(s) log file, website
> directory, and anything else.
>
> Has someone already got a script that does this (at least accepting FTP
> connections), or is this a crazy idea that's just not possible?
> Should I just compile the latest version of some FTP server, and try and
> configure that to do what I want instead?
>
> Thanks.
> --
>

Although possible, that's probably not a good idea for numerous reasons.

I'd strongly recommend using vsFTPd. I've used it for years and never
had any problem with it.
http://vsftpd.beasts.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP AS an FTP server

2009-02-17 Thread Thodoris



Hi,
This is probably a bit stupid, but I've been having issues getting any 
of the good FTP servers running on my Ubuntu 6.06 (LTS) box.
I've tried Pro-FTP, Pure-FTP, and briefly installed some others, but 
the versions available for my distro don't seem to support MySQL (or 
I'm simply doing something wrong).


AFAIK in most distros the ftp servers come without mysql (or database) 
authentication support. If this is what is happening in your case you 
need to compile the ftp server from source adding a configuration time 
option to enable the database support.




Anyway, I had the thought that the FTP server won't be used much, as I 
mainly use SSH, however I need to be able to give other people access, 
which is why I'm wondering if there are any PHP scripts that can be 
used AS an FTP server. That is, I'd setup Apache to accept on the 
standard FTP port(s), and get it to point everything to a PHP script, 
which I could then use to pull user/pass details each of which would 
have their own directories, allowing each user to access a sym-link to 
their domain(s) log file, website directory, and anything else.


In case you have ssh enabled you may use the sftp subsystem that openssh 
supports if it fits your needs. It's more secure than plain ftp but you 
still have to add local user accounts which is a bad idea imo.


You may use PHP to upload files using the http (and not the ftp) 
protocol by making a project that authenticates the user provides him 
the ability to upload, delete and download files using forms.


There has to be something already written that implements such a 
procedure in case you don't want to code this by yourself. You may 
google to find whatever fits your needs.




Has someone already got a script that does this (at least accepting 
FTP connections), or is this a crazy idea that's just not possible?
Should I just compile the latest version of some FTP server, and try 
and configure that to do what I want instead?


I suggest that since you need ftp access it would be much better if you 
could configure an ftp server instead of writing something on your own.
The vsftp daemon is a good solution to your problem written including 
advanced security features but I don't know  if it supports mysql 
authentication. On the other hand pro-ftpd does support modular 
authentication (mysql, ldap etc) if you compile the proper module.




Thanks.


--
Thodoris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP AS an FTP server

2009-02-17 Thread Michael Kubler

Hi,
This is probably a bit stupid, but I've been having issues getting any 
of the good FTP servers running on my Ubuntu 6.06 (LTS) box.
I've tried Pro-FTP, Pure-FTP, and briefly installed some others, but the 
versions available for my distro don't seem to support MySQL (or I'm 
simply doing something wrong).


Anyway, I had the thought that the FTP server won't be used much, as I 
mainly use SSH, however I need to be able to give other people access, 
which is why I'm wondering if there are any PHP scripts that can be used 
AS an FTP server. That is, I'd setup Apache to accept on the standard 
FTP port(s), and get it to point everything to a PHP script, which I 
could then use to pull user/pass details each of which would have their 
own directories, allowing each user to access a sym-link to their 
domain(s) log file, website directory, and anything else.


Has someone already got a script that does this (at least accepting FTP 
connections), or is this a crazy idea that's just not possible?
Should I just compile the latest version of some FTP server, and try and 
configure that to do what I want instead?


Thanks.
--

Michael Kubler
*G*rey *P*hoenix *P*roductions