Kategorie: Linux

Installing vsftpd on a Debian system 11

The following guide describes how to install ftp vsftpd server in Debian system 11.
We will do everything from the terminal by executing a few simple commands.

The first step is to run the terminal or log in to our server via ssh and install:

sudo apt install vsftpd -y

Run it on your system:

sudo systemctl start vsftpd
sudo systemctl status vsftpd
systemctl enable vsftpd.service

We add a new user to the system:

sudo adduser testowyftp

We add to the program configuration:

echo "testowyftp" | sudo tee -a  /etc/vsftpd.userlist

We create a directory for user files:

sudo mkdir -p / home / testowyftp / ftp_directory
sudo chown nobody:nogroup /home/testowyftp/ftp_directory
sudo chmod a-w / home / testowyftp / ftp_directory
sudo mkdir -p /home/testowyftp/ftp_directory/ftp_data
sudo chown testowyftp:testowyftp / home / testowyftp / ftp_directory / ftp_data
cd / home / testowyftp / ftp_directory /
chmod -R 777 ftp_data

We do a backup of the ftp configuration file

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak

We edit the file and make changes:

nano /etc/vsftpd.conf

We will change as follows:

anonymous_enable=NO

local_enable=YES

And we set it in the same file:

listen=NO
listen_ipv6=YES
anonymous_enable=NO
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
user_sub_token=$USER
local_root=/home/$USER/ftp_directory
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

We reload the ftp server:

sudo systemctl restart vsftpd

The last step is to add the port 21 to the firewall

sudo ufw allow 21/tcp

sudo ufw allow 22/tcp

sudo ufw reload

That's all, we should now log in correctly to ftp on the test user ftp

Linux

Udostępnij
Opublikowane przez
Linux

Recent posts

KeePass2 2.52 w Ubuntu 22.04

The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń

2 years temu

Installing Master PDF editor in Ubuntu 22.04

Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji

2 years temu

iotop - memory monitoring

Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w

2 years temu

Run multiple commands in one cron job

You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania

2 years temu

Changing the exif data of a photo in the Linux terminal

Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.

2 years temu

Installing Rocket.Chat Server on Rocky Linux 8

The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy

2 years temu