Ubuntu 8.04 vsftpd mysql pamµÄftp·þÎñÆ÷¶ËÎÞ´íÅäÖÃ
ÅäÖû·¾³:UUbuntu 8.04
1.°²×°vsftpd
sudo apt-get install vsftpd
2.´´½¨guestÓû§
vsftpd°²×°µÄʱºò»á×Ô¶¯°²×ªÒ»¸öftpÓû§£¬ÔÚpasswdÖÐɾ³ý
sudo useradd virtual
ÉèÖÃvirtualµÄÃÜÂëΪwebftp
sudo passwd virtual
±à¼virtualÓû§µÄÖ÷Ŀ¼²¢ÉèÖÃshell
sudo vim /etc/passwd
ÎÒÉèÖõÄÊÇvirtual:x:1001:1001::/var/www:/bin/false
/var/www virtualµÄÖ÷Ŀ¼
/bin/false ½ûÖ¹virtualÓû§Öն˵ǽ
3.ÉèÖÃmysqlÊý¾Ý¿âºÍÓû§È¨ÏÞ
ÔÚphpmyadminÖн¨Á¢vsftpÊý¾Ý¿â vsftpÓû§
½¨Á¢Óû§±í
create table users(name char(16) binary,passwd char(16) binary);
²¢ÊÚȨvistualÓû§users±íµÄselectȨÏÞ£¬²¢ÉèÖÃÃÜÂë¡£
4.ÉèÖÃMySQLµÄPAMÑéÖ¤
°²×°libpam-mysql
sudo apt-get install libpam-mysql
ÒªÉèÖÃvsftpdµÄPAMÑéÖ¤Îļþ
sudo cp /usr/share/doc/vsftpd/EXAMPLE/VIRTUAL_USERS/vsftpd.pam /etc/pam.d/vsftpd
°ÑÄÚÈÝÌ滻ΪÈçÏ£º
auth required/lib/security/pam_mysql.so user=virtual passwd=webftp host=localhostdb=vsftp table=users usercolumn=name passwdcolumn=passwd crypt=2
account required/lib/security/pam_mysql.so user=virtual passwd=webftp host=localhostdb=vsftp table=users usercolumn=name passwdcolumn=passwd crypt=2
5.ÉèÖÃvsftpd.conf
guest_enable=YES
guest_username=virtual
ÕâÁ½Ïî±ØÐë´ò¿ª£¬ÆäËûÅäÖÃÇë²éÔÄvsftpd.confµÄÅäÖÃÊÖ²á
6.ÐéÄâÓû§Ä¿Â¼µÄȨÏÞ¸ÄΪֻÄÜÓÉvirtual²Ù×÷£º
sudo chown virtual.virtual /var/www
sudo chmod 755 /var/www
virtual»ñµÃwwwÎļþ¼ÐµÄȨÏÞ£¬²¢ÉèÖÃwwwÎļþ¼ÐȨÏÞΪ755
ÖÁ´Ë£¬×î»ù±¾µÄÐéÄâÓû§ÒѾÍê³É¡£
sudo /etc/init.d/vsftpd restart
ÖØÆôvsftpd·þÎñºó¼´¿ÉÒÔÓÃusers±íÖÐÉèÖõÄÓû§ÃûÃÜÂë½øÐÐwwwÎļþ¼ÐµÄ·ÃÎÊÁË¡£
Ïà¹ØÎĵµ£º
MySQL Reference Manual for version 4.1.0-alpha.
¡¡ÒëÕßÐò
¡¡ÁÐÀàÐÍÓ뺯ÊýË÷Òý
6 MySQL ÓïÑԲο¼
6.1 ÓïÑԽṹ
6.1.1 ÎÄ×Ö£ºÔõôд×Ö·û´®ÓëÊý×Ö
6.1.1.1 ×Ö·û´®
6.1.1.2 Êý×Ö
6.1.1.3 Ê®Áù½øÖÆÖµ
......
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓÃmysqlµÄclient¹¤¾ßÀ´¼ì²é¡£
ÔÚlinuxÏÂÖ´ÐÐ
/usr/local/mysql/bin/ ......
ÔÚÊý¾Ý¿â±íÖУ¬¶Ô×ֶν¨Á¢Ë÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËٶȡ£¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö mytable±í£º
CREATE TABLE mytable(
ID INT NOT NULL,
username VARCHAR(16) NOT NULL
);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË10000Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ£º5555, admin¡£
ÔÚ²éÕÒusername="admin"µÄ¼Ç¼ SELECT * from mytable WHERE username='admin';ʱ£¬Èç¹ ......
¡¡¡¡ÒÔMySQL-server-4.0.14-0.i386.rpmΪÀý£¬·ÅÔÚ/dataĿ¼ÏÂ
¡¡¡¡cd /data
¡¡¡¡rpm -ivh MySQL-server-4.0.14-0.i386.rpm
¡¡¡¡°²×°Íê³ÉºóÔÚ/usr/share/mysqlĿ¼ÖлáÓÐÒ»¸ömysqlµÄÆô¶¯½Å±¾mysql.server¼°Ê¾ÀýÅäÖÃÎļþµÈ(Èçmy-huge.cnf¡¢my-large.cnf¡¢my-medium.cnf)
¡¡¡¡¿½±´Ò»¸öʾÀýÅäÖÃÎ ......
1¡¢µÇ½MySQL:
mysql -u root -p
2¡¢²é¿´Óû§ÐÅÏ¢
select user,host,password from mysql.user;
select user,host from mysql.user;
3¡¢ÉèÖÃÃÜÂë
set password for root@localhost=password('
ÔÚÕâÀïÌîÈërootÃÜÂë
');
4¡¢ÐÞ¸ÄÃÜÂë
·½·¨1£ºmysqladmin -u root -p password newpassword
·½·¨2£º ££mysql -u root ......