0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Build FTP servers on Oracle Linux 7 in the Oracle Cloud Infrastructure

Last updated at Posted at 2020-12-05

Step.1 Change OS basic configuration on FTP Server

Step.1-1 Stop SELINUX and Firewall

sudo setenforce 0
sudo sed -i -e 's/=permissive/=disabled/g' /etc/selinux/config
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service

Step.1-2 Change OS users password rule (DO NOT for PRODUCTION Services)

grep 'password    requisite     pam_pwquality.so' /etc/pam.d/system-auth
grep '= enforce_for_root' /etc/pam.d/system-auth
sudo sed -i -e 's/= enforce_for_root/= /g' /etc/pam.d/system-auth
grep -v '^#' /etc/security/pwquality.conf
sudo sed -i -e 's/ucredit/#ucredit/g' /etc/security/pwquality.conf
sudo sed -i -e 's/ocredit/#ocredit/g' /etc/security/pwquality.conf
echo "ucredit = 0" >> /etc/security/pwquality.conf
echo "ocredit = 0" >> /etc/security/pwquality.conf

Step.2 FTP Server Installation on OracleLinux7

Step.2-1 Create user and FTP data directory

sudo groupadd -g 55555 ftpgrp
sudo useradd -u 55555 ftpuser -g 55555 -G ftpgrp
sudo echo "ftpuser" | passwd --stdin ftpuser
sudo mkdir -p /var/nfs/ftp
sudo chown ftpuser:ftpgrp /var/nfs/ftp
sudo sed -i -e 's/authtok_type=/authtok_type= enforce_for_root/g' /etc/pam.d/system-auth

Step.2-2 Modify Config file

sudo sed -i -e 's/anonymous_enable=YES/anonymous_enable=NO/g' /etc/vsftpd/vsftpd.conf
sudo sed -i -e 's/#chroot_l/chroot_l/g' /etc/vsftpd/vsftpd.conf
sudo sed -i -e 's/chroot_local_user=NO/chroot_local_user=YES/g' /etc/vsftpd/vsftpd.conf
sudo sed -i -e 's/listen=NO/listen=YES/g' /etc/vsftpd/vsftpd.conf
sudo sed -i -e 's/listen_ipv6=YES/listen_ipv6=NO/g' /etc/vsftpd/vsftpd.conf
echo pasv_enable=YES >> /etc/vsftpd/vsftpd.conf
echo user_config_dir=/etc/vsftpd/user_conf >> /etc/vsftpd/vsftpd.conf
mkdir /etc/vsftpd/user_conf
touch /etc/vsftpd/user_conf/ftpuser
echo local_root=/var/nfs/ftp > /etc/vsftpd/user_conf/ftpuser
echo ftpuser >> /etc/vsftpd/chroot_list

Step.2-3 Restart service

systemctl restart vsftpd
systemctl status vsftpd

Step.3

Step.3-1 Install FTP Client

sudo yum -y install ftp

Step.3-2 Confirm FTP Connection

ftp ftpuser@localhost
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?