yum install -y gcc make autoconf libtool openssl openssl-devel
timedatectl set-timezone Asia/Tokyo
curl -L -O ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.8b.tar.gz tar zxvf proftpd-1.3.8b.tar.gz cd proftpd-1.3.8b ./configure --prefix=/usr/local/proftpd --with-modules=mod_tls make sudo make install
/usr/local/proftpd/etc/proftpd.conf
Umask 002 User nobody Group nobody PidFile /usr/local/proftpd/var/proftpd.pid PassivePorts 7000 7030 AuthOrder mod_auth_file.c AuthUserFile /etc/ftpd.passwd SetEnv TZ :/etc/localtime UseReverseDNS on TimesGMT off
FTPのバーチャルユーザ用に、/sbin/nologinを利用したいので、/etc/shellsに追加しておく。
※これをやっておかないと、ログイン失敗します。
echo '/sbin/nologin' >> /etc/shells
ftppasswdコマンドで、FTPのバーチャルユーザ作成
/usr/local/proftpd/bin/ftpasswd --passwd --file=/etc/ftpd.passwd \ --name ftp_user \ --uid=1000 --gid=1000 \ --home=/var/www/vhost/hogehoge \ --shell=/sbin/nologin
起動は/sbinにある、proftpdを実行するだけです。
/usr/local/proftpd/sbin/proftpd
[root@vm-rocky ~]# tail /var/log/xferlog Wed Nov 27 06:44:03 2024 0 _gateway 19752808 /home/rocky/proftpd-1.3.8b.tar.gz b _ o r ftp_user2 ftp 0 * c Wed Nov 27 06:46:17 2024 2 10.10.10.249 45185224 /home/rocky/Firefox_Setup_51.0.1.exe b _ i r ftp_user2 ftp 0 * c Wed Nov 27 15:55:31 2024 4 10.10.10.249 65672296 /home/rocky/jre-8u381-windows-x64.exe b _ i r ftp_user2 ftp 0 * c
/etc/systemd/system/proftpd.service
[Unit] Description=ProFTPD FTP Server After=network.target [Service] Type=forking ExecStart=/usr/local/proftpd/sbin/proftpd ExecReload=/bin/kill -HUP $MAINPID ExecStop=/bin/kill -TERM $MAINPID PIDFile=/usr/local/proftpd/var/proftpd.pid Restart=on-failure [Install] WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable proftpd
systemctl start proftpd