feb
7

Installera vsftpd med MySql

Author admin    Category Program     Tags ,

vsftpd är en säker, snabb och smidig FTP server som fungerar med MySql stöd.

Installera nödvändiga paket (se till så att MySql är installerat)

apt-get install vsftpd libpam-mysql

Skapa databasen och skriv in den första användaren

mysql -u root -p

CREATE DATABASE ftpd;
USE ftpd;
CREATE TABLE users (username varchar (30) NOT NULL, password varchar(50) NOT NULL, PRIMARY KEY (username)) TYPE=MyISAM;
INSERT INTO users (username, password) VALUES (’user1’, PASSWORD(’password1’));
GRANT SELECT ON ftpd.users to vsftpd@localhost identified by ’dittlösenord’;
exit;

Ersätt dittlösenord med ett starkt och bra lösenord som vsftpd sedan kommer att använda för att identifiera sig.

Läs även  Hur du installerar vsftpd

Konfigurera vsftpd

nano /etc/vsftpd.conf

Ändra dessa rader i filen och lämna allt annat som det är.

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/var/www/$USER
chroot_local_user=YES
hide_ids=YES
guest_username=vsftpd

Variabeln local_root sätter du till den mapp där du vill ha ftpn.

Konfigurera PAM för kontroll av MySql databasen

nano /etc/pam.d/vsftpd

auth required pam_mysql.so user=vsftpd passwd=yourpassword host=localhost db=ftpd table=users usercolumn=username passwdcolumn=password crypt=2
account required pam_mysql.so user=vsftpd passwd=yourpassword host=localhost db=ftpd table=users usercolumn=username passwdcolumn=password crypt=2

Allting annat än det som står ovan kan du ta bort i denna filen

Skapa en användare som används för att identifiera ftpn

useradd –home /home/vsftpd –gid nogroup -m –shell /bin/false vsftpd

Starta om vsftpd

/etc/init.d/vsftpd restart

Skapa avändarens hemkatalog eftersom vsftpd inte gör det automatiskt

mkdir /var/www/user
chown vsftpd:nogroup /var/www/user

Be Sociable, Share!

Post comment

You must be logged in to post a comment.

Reggad på Commo.se Pinga Frisim
PRchecker.info
Twingly BlogRank
bloggping
Datorer & Mobilt Datorer bloggar
Creeper
Nätets bästa sajter! MediaCreeper it-bloggar.se
Online: Idag: Vecka: Denna Månad:
  • Partner links

  • Senaste inläggen

    Arkiv

    Kategorier

    Debian
    Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fdebian-gnulinux-3-1-bible%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fubuntu-linux-toolbox-1000-commands-for-ubuntu-and-debian-power-users%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fdebian-7%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fpa-aventyr-med-raspberry-pi%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fraspberry-pi-projects-for-dummies%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fkraftfullare-enkortsdator%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fsa-installerar-du-geneweb%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179 Warning: file_get_contents(http://urls.api.twitter.com/1/urls/count.json?url=http%3A%2F%2Fdebian.targenor.se%2Fphpsysinfo%2F): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /storage/content/18/1006818/debian.targenor.se/public_html/wp-content/plugins/most-shared-posts/msp-fetch.php on line 179