Install FTP server on VPS

To install and configure an FTP server on your VPS digital ocean, you can follow these steps:

1. Log in to your VPS using SSH.

2. Update the package list by running the following command:

sudo apt-get update

3. Install the FTP server package, vsftpd:

sudo apt-get install vsftpd

4. Once the installation is complete, you need to configure the FTP server. Open the configuration file for vsftpd:

sudo nano /etc/vsftpd.conf

5. Make the following changes to the configuration file:

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/ftp
pasv_min_port=40000
pasv_max_port=50000
listen_ipv6=YES

Here, you are disabling anonymous login, enabling local users, allowing write access, setting the local root directory to the user's home directory plus an ftp directory, and enabling passive mode.

6. Save the configuration file and exit.

7. Restart the vsftpd service to apply the changes:

sudo systemctl restart vsftpd

8. Open the FTP port in the firewall. If you are using the default firewall, UFW, run the following commands:

sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 40000:50000/tcp

These commands allow the FTP control port, data transfer port, and passive mode ports.

9. Finally, create a new FTP user account by running the following command:

sudo adduser ftpuser

Replace ftpuser with the desired username.

Now, you can use an FTP client such as FileZilla to connect to your VPS and transfer files. Make sure to use the new FTP user account and its password to log in.

Komentar

Postingan populer dari blog ini

WhatsApp Web login QR code in an HTML page using whatsapp-web.js

Node.js Telegram Bot API send an image with text

Add these security headers to your website