-
-
Save Fonsan/543f84b39921396728fecb98807373cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update # -yes? | |
sudo yum groupinstall "Development Tools" | |
sudo yum install openssl-devel htop | |
mkdir install | |
cd install | |
wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.41.tar.gz | |
tar -xvzf pure-ftpd-1.0.41.tar.gz | |
cd pure-ftpd-* | |
./configure --with-tls --with-ftpwho --with-puredb --without-pam | |
make | |
sudo make install | |
sudo mkdir -p /etc/pure-ftpd | |
sudo cp configuration-file/pure-ftpd.conf /etc/pure-ftpd/pure-ftpd.conf | |
sudo cp configuration-file/pure-config.pl /usr/sbin/pure-config.pl | |
sudo chmod 755 /usr/sbin/pure-config.pl | |
# init script from: https://www.howtoforge.com/how-to-compile-pure-ftpd-on-centos-7 | |
sudo chmod 755 /etc/init.d/pure-ftpd | |
sudo mkdir -p /etc/ssl/private | |
sudo openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 | |
sudo openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout \ | |
/etc/ssl/private/pure-ftpd.pem \ | |
-out /etc/ssl/private/pure-ftpd.pem | |
sudo chmod 600 /etc/ssl/private/*.pem | |
sudo groupadd ftpgroup | |
sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser | |
sudo pure-pw useradd ftpaccount -u ftpuser -f /etc/pureftpd.passwd -d /mnt/s3/ftpaccount | |
sudo /usr/local/bin/pure-pw mkdb | |
yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap automake openssl-devel | |
git clone https://github.com/s3fs-fuse/s3fs-fuse | |
cd s3fs-fuse/ | |
./autogen.sh | |
./configure --prefix=/usr --with-openssl | |
make | |
sudo make install | |
# find user id of ftpuser and ftpgroup... e.g. 501 (grep ftpuser /etc/passwd) | |
sudo su - | |
echo -e "s3fs#schibsted-ftp-upload\t/mnt/s3\tfuse\tuser,uid=501,gid=501,idmap=user\t0\t0" >> /etc/fstab | |
echo "schibsted-ftp-upload:AWSACCESSKEY:AWSSECRETACCESSKEY" > /etc/passwd-s3fs | |
chown :ftpgroup /etc/passwd-s3fs | |
chmod 640 /etc/passwd-s3fs | |
sudo yum install openssl | |
mkdir -p /mnt/s3/ftpaccount # where ftpaccount == ftp username | |
# start the serverrrr | |
sudo service pure-ftpd start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment