M/s VIKASH TECH - We Write Imaginations to Codes..!!

How to make your old PC a FTP Server ?

FTP

If you are having an old PC and want to utilize it in the modern world. You can do it by simply setting it up as a server for keeping your files on it.

FTP stands for File Transfer Protocol. It has been a standard method for transferring files between computers for decades.

Although security measures have been added, FTP is by nature an insecure method for transferring files. However, it can be useful when making files available to multiple users, or when working in a secure and private network.

To setup your follow our How to make your PC a FTP server ? guide below and set your own FTP server, which you can access over the internet.

PREREQUISITE

You need to have

  • A PC / Laptop
  • Internet connection
  • A static public IP (connect with your ISP for this)
  • You need to download and install Cent OS 7 on your PC. For this you can read our guide on How to download and install CentOS 7 ?
  • Access to a user account with sudo privileges
  • The yum package manager, installed by default
  • A text editor of your choice

Without further a do, let’s get started with setting up the FTP server, on your CentOS 7 PC.

Install FTP Service with VSFTPD

How to install FTP Server on CentOS7 with VSFTPD
How to install FTP Server on CentOS7 with VSFTPD

Here we are using the VSFTPD ,which stands for Very Secure FTP Daemon software package. It’s a relatively easy software utility to use for creating an FTP server.

After logging in to the CentOS 7, in the console, start typing the commands as below:

  • To install the FTP services let’s first start with updating the server packages.
sudo yum update

It can take time to update the packages, sit back and let it complete.

  • Install VSFTPD software with the following command:
sudo yum install vsftpd

It can ask you for the permission to download and install the package. Simply type Y and hit Enter and let the process complete.

  • Start the VSFTPD services by hitting the following command
sudo systemctl start vsftpd
  • Setup auto-launch for the VSFTPD services when system reboots
sudo systemctl enable vsftpd
  • Once you are done with the above, you need to setup rules to use the FTP port number 21 in your firewall.
sudo firewall-cmd --zone=public --permanent --add-port=21/tcp
sudo firewall-cmd --zone=public --permanent --add-service=ftp
sudo firewall-cmd –-reload

Run the above code one by one and it should give you a success output for all the three.

Congrats! you have installed your VSFTPD services. Now let’s move forward with configuration of the VSFTPD services.

Configuring VSFTPD

The behavior of the FTP service on your server is decided based on the /etc/vsftpd/vsftpd.conf configuration file.

Let’s first backup the required files so that in case of any configuration failures, we can use the backup.

First of all, create a copy of /etc/vsftpd/vsftpd.conf file

sudo cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.default

Now, let’s edit the configuration file with the following command:

sudo nano /etc/vsftpd/vsftpd.conf

Set your FTP server to disable anonymous users and allow local users.

Find the following entries in the configuration file, and edit them to match the following:

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES

In above snippet, we are disabling the anonymous user access to secure our server access from unknown users,
We are allowing only local user access
We are allowing logged in users to upload files in the server
Limiting FTP users to their own home directory.

The vsftpd utility provides a way to create an approved user list. To manage users this way, find the userlist_enable entry, then edit the file to look as follows:

userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO

You can now edit the /etc/vsftpd/user_list file, and add your list of users. (List one per line.) The userlist_deny option lets you specify users to be included; setting it to yes would change the list to users that are blocked.

Once you’re finished editing the configuration file, save your changes. Restart the vsftpd service to apply changes:

sudo systemctl restart vsftpd

Lets move forward and create our FTP User

Create a New FTP User

sudo adduser testuser
sudo passwd testuser123

The system may prompt you to enter and confirm a password for the new user.

Add the new user to the userlist:

echo “testuser” | sudo tee –a /etc/vsftpd/user_list

Create directory for FTP User access

sudo mkdir –p /home/testuser/ftp/upload
sudo chmod 550 /home/testuser/ftp
sudo chmod 750 /home/testuser/ftp/upload
sudo chown –R testuser: /home/testuser/ftp

This creates a home/testuser directory for the new user, with a special directory for uploads. It sets permissions for uploads only to the /uploads directory.

Now, you can log in to your FTP server with the user you created:
You can use ftp client software like FileZilla to access your server using your server public IP (must have ftp port forwarding to your server IP on your router) as the host name, your username, password and port number 21.

You c

Conclusion

Now you know how to set up and install an FTP server on Centos 7 with VSFTPD. You should be able to login to your server via FTP and start transferring files.

If you still face issues setting up your FTP Server, or require services related to Server Setup, please get in touch with us here, our team will be happy to help you.

Category :

Comments

No comments found.

Leave a Comment

Latest Posts

PHP Security

Website Security - PHP: Implementing Security To Your Website

Security is one of the major concerns today and when it comes to coding, It becomes a point to re-think…

Total blocking time

Total Blocking Time (TBT): How it affects your website?

It's great to create a website and move your business online. Almost everyone does the same but there are certain…

Common variations of the websites

Common variations of the website, choose which suits you the best.

There are lots of options for creating websites, here we are going to share you some common types of websites…

E-Commerce - Want to sell online?

E-Commerce : Want to sell online?

It is always a good idea to move your business with the latest trend. Today, when the entire world is…

Tags