4. Konfigüre Pure-Ftpd
/etc/pure-ftpd/db/mysql.conf dosyasinin duzenlenmesi;
cp /etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf_orig
mysql.conf dosyasini yedekledim her ihtimale karsi.
cat /dev/null > /etc/pure-ftpd/db/mysql.conf
vi /etc/pure-ftpd/db/mysql.conf
MYSQLSocket /var/run/mysqld/mysqld.sock
#MYSQLServer localhost
#MYSQLPort 3306
MYSQLUser pureftpd
MYSQLPassword fikri
MYSQLDatabase pureftpd
#MYSQLCrypt md5, cleartext, crypt() or password() – md5 is VERY RECOMMENDABLE uppon cleartext
MYSQLCrypt md5
MYSQLGetPW SELECT Password FROM ftpd WHERE User=”\L” AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MYSQLGetUID SELECT Uid FROM ftpd WHERE User=”\L” AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MYSQLGetGID SELECT Gid FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MYSQLGetDir SELECT Dir FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User=”\L”AND status=”1″ AND (ipaccess = “*” OR ipaccess LIKE “\R”)
dosya sonu…
Dosya bu sekilde duzenledikten sonra kaydedip cikalim. Database ismine, database kullanicisina ve sifresine dikkat edelim. Makaleden bagimsiz birseyler belirlediyseniz duzenlemeyi unutmayin.
echo “yes” > /etc/pure-ftpd/conf/ChrootEveryone
Chroot secenegi her kullanicinin kendi dir’ inda kalmasini saglar ve boylelikle kullanicilar kendileri ile alakasiz dizinleri gezemezler.
echo “yes” > /etc/pure-ftpd/conf/CreateHomeDir
CreateHomeDir ise her yeni kullaniciya HomeDiR’ i olusturur.
vi /etc/default/pure-ftpd-common
# Configuration for pure-ftpd
# (this file is sourced by /bin/sh, edit accordingly)
# STANDALONE_OR_INETD
# valid values are “standalone” and “inetd”.
# Any change here overrides the setting in debconf.
STANDALONE_OR_INETD=standalone
# VIRTUALCHROOT:
# whether to use binary with virtualchroot support
# valid values are “true” or “false”
# Any change here overrides the setting in debconf.
VIRTUALCHROOT=false
# UPLOADSCRIPT: if this is set and the daemon is run in standalone mode,
# pure-uploadscript will also be run to spawn the program given below
# for handling uploads. see /usr/share/doc/pure-ftpd/README.gz or
# pure-uploadscript(8)
# example: UPLOADSCRIPT=/usr/local/sbin/uploadhandler.pl
UPLOADSCRIPT=
# if set, pure-uploadscript will spawn $UPLOADSCRIPT running as the
# given uid and gid
UPLOADUID=
UPLOADGID=
#dosya sonu
STANDALONE_OR_INETD seceneginin Standalone olduguna emin olun.
vi /etc/inetd.conf
[…]
#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper
[…]
/etc/init.d/openbsd-inetd restart
/etc/init.d/pure-ftpd-mysql restart
Servislere restart atiyoruz.
5. Kullanici ekleme ve test etme
mysql -u root -p
USE pureftpd;
INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`, `ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`, `QuotaFiles`) VALUES (‘dinopsys’, ‘1’, MD5(‘qazxsw’), ‘2007’, ‘2007’, ‘/home/www.dinopsys.net’, ‘100’, ‘100’, ”, ‘*’, ’50’, ‘0’);
MySQL’ e root olarak giris yaptim, Pureftpd db sine baglandim, dinopsys kullanici isimli qazxsw sifreli 2007 idli user ve gruba bagli home dizini /home/www.dinopsys.net olan 100 Kbps upload ve download limiti olan, herhangi bir ip adresinden ftpye erisebilen ve 50 mb kotasi olan bir kullanici olusturdum.
quit;
komutuyla db den ayrildim.
ls -l /home
server1:/etc/default# ls -l /home
total 8
drwxr-xr-x 2 ftpuser ftpgroup 4096 2007-05-04 11:21 www.dinopsys.net
Evet klasorumde olusmus hayirli olsun…
No responses yet