miless Posted August 13, 2009 Share Posted August 13, 2009 I'm a bit paranoid about my server being accessed through FTP by other people: I would like to write some script to detect if a FTP connection is currently active on my server. (I would use cron to run this script every minute.) I have read the PHP FTP functions but I'm not sure if this can actually be done. Is this possible using PHP or do I have to look at Python or some other language? Link to comment https://forums.phpfreaks.com/topic/170131-detect-a-ftp-connection/ Share on other sites More sharing options...
will35010 Posted August 13, 2009 Share Posted August 13, 2009 Is it a linux server or a windows server? On linux, your script could use the exec function to do a ps -ef | grep ftp or whatever the process is named and go from there. http://us.php.net/function.exec Link to comment https://forums.phpfreaks.com/topic/170131-detect-a-ftp-connection/#findComment-897432 Share on other sites More sharing options...
hostingon Posted August 13, 2009 Share Posted August 13, 2009 The easiest way is to configure firewall in way that only from your IP address you can connect to ftp server. Link to comment https://forums.phpfreaks.com/topic/170131-detect-a-ftp-connection/#findComment-897570 Share on other sites More sharing options...
will35010 Posted August 13, 2009 Share Posted August 13, 2009 The easiest way is to configure firewall in way that only from your IP address you can connect to ftp server. That would be easiest, but maybe the OP has a reason for wanting to use php. Like sending him an email or something. Link to comment https://forums.phpfreaks.com/topic/170131-detect-a-ftp-connection/#findComment-897585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.