{"id":708,"date":"2013-04-02T19:15:19","date_gmt":"2013-04-02T17:15:19","guid":{"rendered":"http:\/\/blog.rabahi.net\/?page_id=708"},"modified":"2014-08-04T17:41:09","modified_gmt":"2014-08-04T15:41:09","slug":"srv-ftp","status":"publish","type":"page","link":"https:\/\/blog.rabahi.net\/?page_id=708","title":{"rendered":"srv-ftp"},"content":{"rendered":"<h1>Prerequiste<\/h1>\n<p>I assume that you have a Centos installation.<\/p>\n<h1>Installation<\/h1>\n<p>You can copy\/paste this script and use it to configure automatically your server.<\/p>\n<pre class=\"bash\" style=\"font-family:monospace;\"><ol><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;install vsftpd&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">dnf <span style=\"color: #660033;\">-y<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">install<\/span> vsftpd <span style=\"color: #666666; font-style: italic;\">#pam_mysql<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create firewall service&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>firewalld<span style=\"color: #000000; font-weight: bold;\">\/<\/span>services<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftp.xml <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">&lt;<\/span>?xml <span style=\"color: #007800;\">version<\/span>=<span style=\"color: #ff0000;\">&quot;1.0&quot;<\/span> <span style=\"color: #007800;\">encoding<\/span>=<span style=\"color: #ff0000;\">&quot;utf-8&quot;<\/span>?<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">&lt;<\/span>service<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"> <span style=\"color: #000000; font-weight: bold;\">&lt;<\/span>short<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span>vsftp<span style=\"color: #000000; font-weight: bold;\">&lt;\/<\/span>short<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"> <span style=\"color: #000000; font-weight: bold;\">&lt;<\/span>description<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><span style=\"color: #c20cb9; font-weight: bold;\">ftp<\/span> server<span style=\"color: #000000; font-weight: bold;\">&lt;\/<\/span>description<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"> <span style=\"color: #000000; font-weight: bold;\">&lt;<\/span>port <span style=\"color: #007800;\">protocol<\/span>=<span style=\"color: #ff0000;\">&quot;tcp&quot;<\/span> <span style=\"color: #007800;\">port<\/span>=<span style=\"color: #ff0000;\">&quot;21&quot;<\/span><span style=\"color: #000000; font-weight: bold;\">\/&gt;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">&lt;\/<\/span>service<span style=\"color: #000000; font-weight: bold;\">&gt;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;add service vsftp (port 21) to firewall&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">firewall-cmd <span style=\"color: #660033;\">--permanent<\/span> <span style=\"color: #660033;\">--add-service<\/span> vsftp<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create database vsftpd, user\/password vsftpd\/vsftpd&quot;<\/span>:<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">&quot;CREATE USER 'vsftpd'@'localhost' IDENTIFIED BY 'vsftpd';&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">&quot;CREATE DATABASE IF NOT EXISTS vsftpd;&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">&quot;use vsftpd; GRANT ALL PRIVILEGES ON vsftpd.* TO 'vsftpd'@'localhost' WITH GRANT OPTION;&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;initialize vsftpd table&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; CREATE TABLE IF NOT EXISTS `vsftpd`.`users` (`id_user` int(11) NOT NULL auto_increment,`login` varchar(50) NOT NULL,`password` varchar(100) NOT NULL,`active` int(11) NOT NULL,PRIMARY KEY  (`id_user`)) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;'<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; CREATE TABLE IF NOT EXISTS `vsftpd`.`log` (`id_log` int(11) NOT NULL auto_increment,`login` varchar(50) NOT NULL,`message` varchar(200) NOT NULL,`pid` varchar(10) NOT NULL,`host` varchar(30) NOT NULL,`time` datetime default NULL,PRIMARY KEY  (`id_log`)) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;'<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Configure \/etc\/vsftpd\/vsftpd.conf&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd.conf <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Listen port<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">listen_port<\/span>=<span style=\"color: #000000;\">21<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># You may fully customise the login banner string:<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">ftpd_banner<\/span>=Welcome to blah FTP service.<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># PAM configuration file<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">pam_service_name<\/span>=vsftpd<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># When &quot;listen&quot; directive is enabled, vsftpd runs in standalone mode and<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># listens on IPv4 sockets. This directive cannot be used in conjunction<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># with the listen_ipv6 directive.<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">listen<\/span>=YES<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Allow anonymous FTP? (Beware - allowed by default if you comment this out).<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">anonymous_enable<\/span>=NO<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">anon_world_readable_only<\/span>=NO<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">anon_upload_enable<\/span>=NO<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">anon_mkdir_write_enable<\/span>=NO<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">anon_other_write_enable<\/span>=NO<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Uncomment this to allow local users to log in.<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">local_enable<\/span>=YES<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Userlist file<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">userlist_file<\/span>=<span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_list<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">userlist_enable<\/span>=YES<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">userlist_deny<\/span>=YES<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Uncomment this to enable any form of FTP write command.<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">write_enable<\/span>=NO<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Allow un-anonymous guest users to connect to ftp (map to ftpsecure)<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">guest_enable<\/span>=YES<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">guest_username<\/span>=ftpsecure<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># You may specify an explicit list of local users to chroot() to their home<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># directory. If chroot_local_user is YES, then this list becomes a list of<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># users to NOT chroot().<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">chroot_local_user<\/span>=YES<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Maximum number of simultaneous connection<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">max_clients<\/span>=<span style=\"color: #000000;\">50<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Maximum number of connections from the same IP<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Note, if you set value to 1, you won't be able to upload \/ download files (because it will create a new connection)<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">max_per_ip<\/span>=<span style=\"color: #000000;\">10<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># Record specific user configuration<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">user_config_dir<\/span>=<span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># The target log file can be vsftpd_log_file or xferlog_file.<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># This depends on setting xferlog_std_format parameter<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">xferlog_enable<\/span>=YES<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># PASV - passive ports for FTP (range 44000 - 44100 ; 100 PASV ports, OPEN FIREWALL FOR ALLOWING CONNECTIONS<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">pasv_enable<\/span>=YES<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">pasv_min_port<\/span>=<span style=\"color: #000000;\">44000<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">pasv_max_port<\/span>=<span style=\"color: #000000;\">44100<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">chmod<\/span> <span style=\"color: #000000;\">600<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd.conf<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Add non-privileged user ftpsecure&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">useradd <span style=\"color: #660033;\">-G<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">users<\/span> <span style=\"color: #660033;\">-s<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>sbin<span style=\"color: #000000; font-weight: bold;\">\/<\/span>nologin <span style=\"color: #660033;\">-d<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>home<span style=\"color: #000000; font-weight: bold;\">\/<\/span>ftpsecure  ftpsecure<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;configure pam_mysql&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>pam.d<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#%PAM-1.0<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">auth sufficient pam_unix.so<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">account sufficient pam_unix.so<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">auth required <span style=\"color: #000000; font-weight: bold;\">\/<\/span>lib64<span style=\"color: #000000; font-weight: bold;\">\/<\/span>security<span style=\"color: #000000; font-weight: bold;\">\/<\/span>pam_mysql.so <span style=\"color: #007800;\">verbose<\/span>=<span style=\"color: #000000;\">0<\/span> <span style=\"color: #007800;\">user<\/span>=vsftpd <span style=\"color: #007800;\">passwd<\/span>=vsftpd <span style=\"color: #007800;\">host<\/span>=127.0.0.1 <span style=\"color: #007800;\">db<\/span>=vsftpd <span style=\"color: #007800;\">table<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">users<\/span> <span style=\"color: #007800;\">usercolumn<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">login<\/span> <span style=\"color: #007800;\">passwdcolumn<\/span>=password <span style=\"color: #007800;\">crypt<\/span>=<span style=\"color: #000000;\">3<\/span> <span style=\"color: #007800;\">where<\/span>=users.active=<span style=\"color: #000000;\">1<\/span> <span style=\"color: #007800;\">sqllog<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">yes<\/span> <span style=\"color: #007800;\">logtable<\/span>=log <span style=\"color: #007800;\">logmsgcolumn<\/span>=message <span style=\"color: #007800;\">logusercolumn<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">login<\/span> <span style=\"color: #007800;\">logpidcolumn<\/span>=pid <span style=\"color: #007800;\">loghostcolumn<\/span>=host <span style=\"color: #007800;\">logtimecolumn<\/span>=<span style=\"color: #000000; font-weight: bold;\">time<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">account required <span style=\"color: #000000; font-weight: bold;\">\/<\/span>lib64<span style=\"color: #000000; font-weight: bold;\">\/<\/span>security<span style=\"color: #000000; font-weight: bold;\">\/<\/span>pam_mysql.so <span style=\"color: #007800;\">verbose<\/span>=<span style=\"color: #000000;\">0<\/span> <span style=\"color: #007800;\">user<\/span>=vsftpd <span style=\"color: #007800;\">passwd<\/span>=vsftpd <span style=\"color: #007800;\">host<\/span>=127.0.0.1 <span style=\"color: #007800;\">db<\/span>=vsftpd <span style=\"color: #007800;\">table<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">users<\/span> <span style=\"color: #007800;\">usercolumn<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">login<\/span> <span style=\"color: #007800;\">passwdcolumn<\/span>=password <span style=\"color: #007800;\">crypt<\/span>=<span style=\"color: #000000;\">3<\/span> <span style=\"color: #007800;\">where<\/span>=users.active=<span style=\"color: #000000;\">1<\/span> <span style=\"color: #007800;\">sqllog<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">yes<\/span> <span style=\"color: #007800;\">logtable<\/span>=log <span style=\"color: #007800;\">logmsgcolumn<\/span>=message <span style=\"color: #007800;\">logusercolumn<\/span>=<span style=\"color: #c20cb9; font-weight: bold;\">login<\/span> <span style=\"color: #007800;\">logpidcolumn<\/span>=pid <span style=\"color: #007800;\">loghostcolumn<\/span>=host <span style=\"color: #007800;\">logtimecolumn<\/span>=<span style=\"color: #000000; font-weight: bold;\">time<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;generate script to create new user&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">mkdir<\/span> <span style=\"color: #660033;\">-p<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_create.bash <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">EXPECTED_ARGS<\/span>=<span style=\"color: #000000;\">2<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">if<\/span> <span style=\"color: #7a0874; font-weight: bold;\">[<\/span> <span style=\"color: #007800;\">$#<\/span> <span style=\"color: #660033;\">-ne<\/span> <span style=\"color: #007800;\">$EXPECTED_ARGS<\/span> <span style=\"color: #7a0874; font-weight: bold;\">]<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">then<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Usage: <span style=\"color: #780078;\">`basename $0`<\/span> {user} {password}&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">exit<\/span> <span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">fi<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">user<\/span>=<span style=\"color: #007800;\">$1<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">password<\/span>=<span style=\"color: #007800;\">$2<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create new user <span style=\"color: #007800;\">$user<\/span>\/<span style=\"color: #007800;\">$password<\/span> (i.e. user\/password)&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; INSERT INTO `vsftpd`.`users` (`id_user`, `login`, `password`, `active`) VALUES (NULL, &quot;'<\/span><span style=\"color: #007800;\">$user<\/span><span style=\"color: #ff0000;\">'&quot;, MD5(&quot;'<\/span><span style=\"color: #007800;\">$password<\/span><span style=\"color: #ff0000;\">'&quot;), 1);'<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">mkdir<\/span> <span style=\"color: #660033;\">-p<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">mkdir<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>home<span style=\"color: #000000; font-weight: bold;\">\/<\/span>ftpsecure<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">chown<\/span> ftpsecure:users <span style=\"color: #000000; font-weight: bold;\">\/<\/span>home<span style=\"color: #000000; font-weight: bold;\">\/<\/span>ftpsecure<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span> <span style=\"color: #660033;\">-R<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">chmod<\/span> <span style=\"color: #000000;\">700<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>home<span style=\"color: #000000; font-weight: bold;\">\/<\/span>ftpsecure<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span> <span style=\"color: #660033;\">-R<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\"># configuration file<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;local_root=<span style=\"color: #007800;\">$user<\/span>&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;write_enable=YES&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;anon_upload_enable=YES&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;anon_mkdir_write_enable=YES&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;anon_other_write_enable=YES&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_disable.bash <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">EXPECTED_ARGS<\/span>=<span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">if<\/span> <span style=\"color: #7a0874; font-weight: bold;\">[<\/span> <span style=\"color: #007800;\">$#<\/span> <span style=\"color: #660033;\">-ne<\/span> <span style=\"color: #007800;\">$EXPECTED_ARGS<\/span> <span style=\"color: #7a0874; font-weight: bold;\">]<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">then<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Usage: <span style=\"color: #780078;\">`basename $0`<\/span> {user}&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">exit<\/span> <span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">fi<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">user<\/span>=<span style=\"color: #007800;\">$1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; UPDATE `vsftpd`.`users` SET `active` = '<\/span><span style=\"color: #000000;\">0<\/span><span style=\"color: #ff0000;\">' WHERE `users`.`login` =&quot;'<\/span><span style=\"color: #007800;\">$user<\/span><span style=\"color: #ff0000;\">'&quot;;'<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_enable.bash <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">EXPECTED_ARGS<\/span>=<span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">if<\/span> <span style=\"color: #7a0874; font-weight: bold;\">[<\/span> <span style=\"color: #007800;\">$#<\/span> <span style=\"color: #660033;\">-ne<\/span> <span style=\"color: #007800;\">$EXPECTED_ARGS<\/span> <span style=\"color: #7a0874; font-weight: bold;\">]<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">then<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Usage: <span style=\"color: #780078;\">`basename $0`<\/span> {user}&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">exit<\/span> <span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">fi<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">user<\/span>=<span style=\"color: #007800;\">$1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; UPDATE `vsftpd`.`users` SET `active` = '<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #ff0000;\">' WHERE `users`.`login` =&quot;'<\/span><span style=\"color: #007800;\">$user<\/span><span style=\"color: #ff0000;\">'&quot;;'<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">cat<\/span> <span style=\"color: #000000; font-weight: bold;\">&gt;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_delete.bash <span style=\"color: #000000; font-weight: bold;\">&lt;&lt;<\/span> <span style=\"color: #ff0000;\">&quot;EOF&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">EXPECTED_ARGS<\/span>=<span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">if<\/span> <span style=\"color: #7a0874; font-weight: bold;\">[<\/span> <span style=\"color: #007800;\">$#<\/span> <span style=\"color: #660033;\">-ne<\/span> <span style=\"color: #007800;\">$EXPECTED_ARGS<\/span> <span style=\"color: #7a0874; font-weight: bold;\">]<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">then<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Usage: <span style=\"color: #780078;\">`basename $0`<\/span> {user}&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">  <span style=\"color: #7a0874; font-weight: bold;\">exit<\/span> <span style=\"color: #000000;\">1<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">fi<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">user<\/span>=<span style=\"color: #007800;\">$1<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">mysql <span style=\"color: #660033;\">--user<\/span>=root <span style=\"color: #660033;\">--password<\/span>=root <span style=\"color: #660033;\">-e<\/span> <span style=\"color: #ff0000;\">'use vsftpd; DELETE FROM `vsftpd`.`users` WHERE `users`.`login` = &quot;'<\/span><span style=\"color: #007800;\">$user<\/span><span style=\"color: #ff0000;\">'&quot;'<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">rm<\/span> <span style=\"color: #660033;\">-f<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">rm<\/span> <span style=\"color: #660033;\">-fr<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>home<span style=\"color: #000000; font-weight: bold;\">\/<\/span>ftpsecure<span style=\"color: #000000; font-weight: bold;\">\/<\/span><span style=\"color: #007800;\">$user<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">EOF<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create \/etc\/vsftpd\/vsftpd_user_conf directory&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">mkdir<\/span> <span style=\"color: #660033;\">-p<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd_user_conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;create new user myuser\/mypassword (i.e. user\/password)&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">bash<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>opt<span style=\"color: #000000; font-weight: bold;\">\/<\/span>vsftpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>scripts<span style=\"color: #000000; font-weight: bold;\">\/<\/span>user_create.bash myuser mypassword<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;launch vsftpd at startup&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">systemctl <span style=\"color: #7a0874; font-weight: bold;\">enable<\/span> vsftpd.service<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;launch vsftpd&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">systemctl start vsftpd.service<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #007800;\">myip<\/span>=<span style=\"color: #000000; font-weight: bold;\">`<\/span><span style=\"color: #c20cb9; font-weight: bold;\">hostname<\/span> -I<span style=\"color: #000000; font-weight: bold;\">`<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Now meet you there: ftp:\/\/<span style=\"color: #007800;\">$myip<\/span>&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;NOTE: try to connect using login\/password : myuser\/mypassword&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>That&#8217;s all \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prerequiste I assume that you have a Centos installation. Installation You can copy\/paste this script and use it to configure automatically your server. That&#8217;s all \ud83d\ude42<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":679,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-708","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=708"}],"version-history":[{"count":4,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/708\/revisions"}],"predecessor-version":[{"id":1039,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/708\/revisions\/1039"}],"up":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/679"}],"wp:attachment":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}