toggle menu

How to setup FTP account on digital ocea?

Dhananjay Kumar |01 Feb at 11:02

I have problem with setup digital ocean on FTP account, please advice.

  • 0 like
  • 1 comment

Dhananjay Kumar01 Feb at 12:02

Hello ,

I have got the solution, Follow the below Steps :

1) Install ufw and run below commands :
a) apt update
b) apt install ufw
c) ufw allow OpenSSH
d) ufw enable /// check status with command : ufw status
e) sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
sudo ufw allow 40000:50000/tcp

2) Install vsftpd
a) sudo apt-get install vsftpd

b) sudo nano /etc/vsftpd.conf

Add /edit below text
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
write_enable=YES

# Prevent the FTP-connected user from accessing any files or commands outside
# the directory tree
chroot_local_user=YES

# Add a user_sub_token in order to insert the username in our local_root directory
# path so our configuration will work for this user and any future users that might
# be added

user_sub_token=$USER
local_root=/var/www/ftp

# Set up the configuration so that access is given to a user only when they
# are explicitly added to a list rather than by default
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

sudo chown nobody:nogroup /var/www/ftp
sudo chmod a-w /var/www/ftp
sudo chown ftpuser:ftpuser /var/www/ftp/myApplication

sudo systemctl restart vsftpd

Also must added :

HTTP on port 80, which is what unencrypted web servers use, using sudo ufw allow http or sudo ufw allow 80
HTTPS on port 443, which is what encrypted web servers use, using sudo ufw allow https or sudo ufw allow 443
FTP on port 21, which is used for unencrypted file transfers (which you probably shouldn't use anyway), using sudo ufw allow ftp or sudo ufw allow 21/tcp

Posted:

01 Feb at 11:02

Viewed:

1038 times

Active:

01 Feb at 12:02