How to install and configure a FTP server on linux (CentOS)
How to install and configure a FTP server on linux (CentOS)
In this guide, we are taking a CentOS 6 server and installing, plus post-install configuring the server, to permit users to access the FTP
server. For our first piece of FTP software, we will install vsftpd. vsftpd stands for “Very Secure FTP Daemon”, which was written and
maintained by Chris Evans. vsftpd is commonly found in third party Linux repositories.
server. For our first piece of FTP software, we will install vsftpd. vsftpd stands for “Very Secure FTP Daemon”, which was written and
maintained by Chris Evans. vsftpd is commonly found in third party Linux repositories.
Install VSFTPD:
We login via SSH and run this command.
# yum install vsftpd
Here is an example of output and here is a screen shot of the installation process:
Running Transaction
Installing : vsftpd-2.2.2-11.el6_3.1.i686
1/1
Verifying : vsftpd-2.2.2-11.el6_3.1.i686
1/1
Installed:
vsftpd.i686 0:2.2.2-11.el6_3.1
Complete!
[root@test ~]#
Once we see “Complete!”, we know vsftpd is installed.
Configure VSFTPD:
Next, we open up /etc/vsftpd/vsftpd.conf with our favorite text editor (nano, pico, vi, etc)
We look for this line: anonymous_enable=NO
Anonymous access is good and bad.
In the past, anonymous access was good with the more polite nature of the Internet. Anonymous access would work, let’s say for Windows 95 file distribution or to download large archives from software vendors. Fast forward to today, anonymous access is bad because it could allow snooping and the downloading of sensitive data. Anonymous access with FTP upload enabled could allow somebody to store offensive, illegal or copyright protected material on your FTP server and could get you in trouble as it appears you are hosting the material – not that it was posted on your FTP server through the “anonymous” account.
We want to go down to:
#chroot_local_user=YES and remove the # mark to enable it.
A fun trick is to go to “#ftpd_banner=Welcome to blah FTP service.”, remove the # and make it say:
ftpd_banner=We are monitoring everything 24/7 with offsite logging.
This could have an informative message, such as your privacy policy, or have messages telling people to go away or for authorization such as if you’re an ISP, educational institution, or hosting provider to contact a specific person to have FTP access assigned to them.
ftpd_banner=Call Bob at extension 123 or email bob@company.com to issue FTP credentials
Once we have made the changes, we save and exit our text editor.
We launch vsftpd with the following command:
# service vsftpd start
If you already had vsftpd and updated the configuration, run this command:
# service vsftpd restart
Now, you have a basic FTP server to connect to!
Local users, ones you have assigned through the “adduser” command, are now able to connect to their /home directories via FTP and any FTP client available such as command line FTP clients or FileZilla, which I highly recommend because it’s easy to use, works on a variety of operating system platforms and is absolutely 100% free.
If you wish to give somebody a FTP account but do not wish for them to access SSH (Secure Shell) which would allow them to issue commands, download files, etc. run these commands below:
# adduser ftpacct
# passwd ftpacct
# usermod -s /sbin/nologin ftpacct
With the “passwd” command, you must set a password for the user “ftpacct”. The third command, “usermod”, prevents users from logging in via SSH as their system default shell is /sbin/nologin which prevents the SSH access.
How to install and configure a FTP server on linux (CentOS)
How to install and configure a FTP server on linux (CentOS)
Terima kasih telah membaca artikel tentang How to install and configure a FTP server on linux (CentOS) di blog Tutorial Opensource and Linux jika anda ingin menyebar luaskan artikel ini di mohon untuk mencantumkan link sebagai Sumbernya, dan bila artikel ini bermanfaat silakan bookmark halaman ini di web browser anda, dengan cara menekan Ctrl + D pada tombol keyboard anda.