FTP not working - 530 Login authentication failed

What is the results of

$ journalctl -u pure-ftpd --no-pager |sed -e "s|$(hostname)|hostname|g"

Try run
systemctl start pure-ftpd.service

I ran both the commands and this is what I am getting.

Kindly just copy paste the following commands:

journalctl -u pure-ftpd --no-pager |sed -e "s|$(hostname)|hostname|g"
# on new line <= this is just a comment to guide you
systemctl status pure-ftpd.service

and copy paste the results here not screenshot

Not really fix but use SFTP by creating on site manager SSH account for site. That will be much more secure option than FTP.

1 Like

ubuntu@instance-test:~$ journalctl -u pure-ftpd --no-pager |sed -e “s|$(hostname)|hostname|g”
Dec 13 06:22:29 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:22:30 hostname pure-ftpd[12185]: Starting ftp server:
Dec 13 06:22:30 hostname pure-ftpd[12193]: Running: /usr/sbin/pure-ftpd -p 40110:40210 -A -P 193.122.135.18 -Y 1 -B
Dec 13 06:22:30 hostname systemd[1]: Started pure-ftpd.service.
Dec 13 06:25:06 hostname systemd[1]: Stopping pure-ftpd.service…
Dec 13 06:25:06 hostname pure-ftpd[12354]: Stopping ftp server: pure-ftpd.
Dec 13 06:25:06 hostname systemd[1]: pure-ftpd.service: Deactivated successfully.
Dec 13 06:25:06 hostname systemd[1]: Stopped pure-ftpd.service.
Dec 13 06:25:06 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:25:06 hostname pure-ftpd[12364]: Starting ftp server:
Dec 13 06:25:06 hostname pure-ftpd[12372]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:25:06 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:25:06 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:25:06 hostname systemd[1]: Failed to start pure-ftpd.service.
– Boot 47dd6ab6a8b34dbe96e766f59aead0c4 –
Dec 13 06:26:24 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:26:26 hostname pure-ftpd[1067]: Starting ftp server:
Dec 13 06:26:26 hostname pure-ftpd[1095]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:26:26 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:26:26 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:26:26 hostname systemd[1]: Failed to start pure-ftpd.service.
Dec 13 06:27:50 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:27:51 hostname pure-ftpd[1763]: Starting ftp server:
Dec 13 06:27:51 hostname pure-ftpd[1771]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:27:51 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:27:51 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:27:51 hostname systemd[1]: Failed to start pure-ftpd.service.
– Boot 0366046163bf4a37b650ef403c8658b7 –
Dec 13 06:29:06 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:29:07 hostname pure-ftpd[1001]: Starting ftp server:
Dec 13 06:29:07 hostname pure-ftpd[1020]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:29:07 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:29:07 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:29:07 hostname systemd[1]: Failed to start pure-ftpd.service.
– Boot f6e348b90da94adeaf7cfbbb927e1eb6 –
Dec 13 06:36:14 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:36:16 hostname pure-ftpd[1067]: Starting ftp server:
Dec 13 06:36:16 hostname pure-ftpd[1103]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:36:16 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:36:16 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:36:16 hostname systemd[1]: Failed to start pure-ftpd.service.
Dec 13 06:42:19 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:42:19 hostname pure-ftpd[2696]: Starting ftp server:
Dec 13 06:42:19 hostname pure-ftpd[2706]: Running: /usr/sbin/pure-ftpd -l pam -O clf:/var/log/pure-ftpd/transfer.log -u 1000 -J HIGH -E -B
Dec 13 06:42:19 hostname systemd[1]: Started pure-ftpd.service.
Dec 13 06:44:45 hostname systemd[1]: Stopping pure-ftpd.service…
Dec 13 06:44:45 hostname pure-ftpd[2847]: Stopping ftp server: pure-ftpd.
Dec 13 06:44:45 hostname systemd[1]: pure-ftpd.service: Deactivated successfully.
Dec 13 06:44:45 hostname systemd[1]: Stopped pure-ftpd.service.
Dec 13 06:44:45 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:44:45 hostname pure-ftpd[2857]: Starting ftp server:
Dec 13 06:44:45 hostname pure-ftpd[2865]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:44:45 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:44:45 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:44:45 hostname systemd[1]: Failed to start pure-ftpd.service.
– Boot 793462e16b7c43b0adfc58496aa14b5d –
Dec 13 06:48:39 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:48:40 hostname pure-ftpd[1048]: Starting ftp server:
Dec 13 06:48:40 hostname pure-ftpd[1073]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:48:40 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:48:40 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:48:40 hostname systemd[1]: Failed to start pure-ftpd.service.
Dec 13 06:57:49 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:57:49 hostname pure-ftpd[1994]: Starting ftp server:
Dec 13 06:57:49 hostname pure-ftpd[2002]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:57:49 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:57:49 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:57:49 hostname systemd[1]: Failed to start pure-ftpd.service.
Dec 13 06:58:32 hostname systemd[1]: Starting pure-ftpd.service…
Dec 13 06:58:32 hostname pure-ftpd[2103]: Starting ftp server:
Dec 13 06:58:32 hostname pure-ftpd[2111]: /usr/sbin/pure-ftpd-wrapper: Couldn’t examine directory /etc/pure-ftpd/conf: No such file or directory
Dec 13 06:58:32 hostname systemd[1]: pure-ftpd.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Dec 13 06:58:32 hostname systemd[1]: pure-ftpd.service: Failed with result ‘exit-code’.
Dec 13 06:58:32 hostname systemd[1]: Failed to start pure-ftpd.service.
ubuntu@instance-test:~$ sudo systemctl status pure-ftpd.service
× pure-ftpd.service
Loaded: loaded (/etc/init.d/pure-ftpd; generated)
Active: failed (Result: exit-code) since Tue 2022-12-13 06:58:32 UTC; 12mi>
Docs: man:systemd-sysv-generator(8)
Process: 2103 ExecStart=/etc/init.d/pure-ftpd start (code=exited, status=2)
CPU: 85ms

Dec 13 06:58:32 instance-test systemd[1]: Starting pure-ftpd.service…
Dec 13 06:58:32 instance-test pure-ftpd[2103]: Starting ftp server:
Dec 13 06:58:32 instance-test pure-ftpd[2111]: /usr/sbin/pure-ftpd-wrapper: Cou>
Dec 13 06:58:32 instance-test systemd[1]: pure-ftpd.service: Control process ex>
Dec 13 06:58:32 instance-test systemd[1]: pure-ftpd.service: Failed with result>
Dec 13 06:58:32 instance-test systemd[1]: Failed to start pure-ftpd.service.
lines 1-13/13 (END)

Well just what i thought pure-ftpd was not fully installed. I also soemthing to indicate it here FTP not working - 530 Login authentication failed - #9 by savors.map when you creating a user for pure-ftpd.

RUn this line by line dont skip

sudo apt-get remove --purge pure-ftpd pure-ftpd-common
sudo apt autoremove
sudo apt install pure-ftpd -y
groupadd -g 2001 ftpgroup
useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser
systemctl start pure-ftpd
mkdir /etc/ssl/private
openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
rm -R /etc/pure-ftpd
mkdir /etc/pure-ftpd
cp /usr/local/CyberCP/install/pure-ftpd-one/* /etc/pure-ftpd/
systemctl restart pure-ftpd

Yes. if you need to go this direction the ideal way that i have done was install cyberpanel without ftp and setup https://devanswers.co/install-ftp-server-vsftpd-ubuntu-20-04/. Works like a charm too.

ubuntu@instance-test:~$ sudo apt-get remove --purge pure-ftpd pure-ftpd-common
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages were automatically installed and are no longer required:
openbsd-inetd tcpd update-inetd
Use ‘sudo apt autoremove’ to remove them.
The following packages will be REMOVED:
pure-ftpd* pure-ftpd-common*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 992 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database … 127926 files and directories currently installed.)
Removing pure-ftpd (1.0.50-2.1) …
Removing pure-ftpd-common (1.0.50-2.1) …
Processing triggers for man-db (2.10.2-1) …
(Reading database … 127858 files and directories currently installed.)
Purging configuration files for pure-ftpd-common (1.0.50-2.1) …
Purging configuration files for pure-ftpd (1.0.50-2.1) …
ubuntu@instance-test:~$ sudo apt autoremove
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages will be REMOVED:
openbsd-inetd tcpd update-inetd
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 290 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database … 127842 files and directories currently installed.)
Removing openbsd-inetd (0.20160825-5) …
Removing tcpd (7.6.q-31build2) …
Removing update-inetd (4.51) …
Processing triggers for man-db (2.10.2-1) …
ubuntu@instance-test:~$ sudo apt install pure-ftpd -y
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following additional packages will be installed:
openbsd-inetd pure-ftpd-common tcpd update-inetd
The following NEW packages will be installed:
openbsd-inetd pure-ftpd pure-ftpd-common tcpd update-inetd
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 367 kB of archives.
After this operation, 1,282 kB of additional disk space will be used.
Get:1 Index of /ubuntu jammy/main amd64 update-inetd all 4.51 [24.9 kB]
Get:2 Index of /ubuntu jammy/universe amd64 tcpd amd64 7.6.q-31build2 [25.2 kB]
Get:3 Index of /ubuntu jammy/universe amd64 openbsd-inetd amd64 0.20160825-5 [26.3 kB]
Get:4 Index of /ubuntu jammy/universe amd64 pure-ftpd-common all 1.0.50-2.1 [148 kB]
Get:5 Index of /ubuntu jammy/universe amd64 pure-ftpd amd64 1.0.50-2.1 [143 kB]
Fetched 367 kB in 1s (456 kB/s)
Preconfiguring packages …
Can’t exec “/tmp/update-inetd.config.NhvPqD”: Permission denied at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178.
open2: exec of /tmp/update-inetd.config.NhvPqD configure failed: Permission denied at /usr/share/perl5/Debconf/ConfModule.pm line 59.
Selecting previously unselected package update-inetd.
(Reading database … 127816 files and directories currently installed.)
Preparing to unpack …/update-inetd_4.51_all.deb …
Unpacking update-inetd (4.51) …
Selecting previously unselected package tcpd.
Preparing to unpack …/tcpd_7.6.q-31build2_amd64.deb …
Unpacking tcpd (7.6.q-31build2) …
Selecting previously unselected package openbsd-inetd.
Preparing to unpack …/openbsd-inetd_0.20160825-5_amd64.deb …
Unpacking openbsd-inetd (0.20160825-5) …
Selecting previously unselected package pure-ftpd-common.
Preparing to unpack …/pure-ftpd-common_1.0.50-2.1_all.deb …
Unpacking pure-ftpd-common (1.0.50-2.1) …
Selecting previously unselected package pure-ftpd.
Preparing to unpack …/pure-ftpd_1.0.50-2.1_amd64.deb …
Unpacking pure-ftpd (1.0.50-2.1) …
Setting up pure-ftpd-common (1.0.50-2.1) …
Setting up update-inetd (4.51) …
Setting up tcpd (7.6.q-31build2) …
Setting up openbsd-inetd (0.20160825-5) …
Setting up pure-ftpd (1.0.50-2.1) …
Processing triggers for man-db (2.10.2-1) …
Scanning processes…
Scanning linux images…

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
ubuntu@instance-test:~$ sudo groupadd -g 2001 ftpgroup
groupadd: group ‘ftpgroup’ already exists
ubuntu@instance-test:~$ sudo useradd -u 2001 -s /bin/false -d /bin/null -c “pureftpd user” -g ftpgroup ftpuser
useradd: user ‘ftpuser’ already exists
ubuntu@instance-test:~$ sudo systemctl start pure-ftpd
ubuntu@instance-test:~$ sudo mkdir /etc/ssl/private
mkdir: cannot create directory ‘/etc/ssl/private’: File exists
ubuntu@instance-test:~$ sudo openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj “/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com” -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
…++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
…++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ubuntu@instance-test:~$ sudo rm -R /etc/pure-ftpd
ubuntu@instance-test:~$ sudo mkdir /etc/pure-ftpd
ubuntu@instance-test:~$ sudo cp /usr/local/CyberCP/install/pure-ftpd-one/* /etc/pure-ftpd/
ubuntu@instance-test:~$ sudo systemctl restart pure-ftpd
Job for pure-ftpd.service failed because the control process exited with error code.
See “systemctl status pure-ftpd.service” and “journalctl -xeu pure-ftpd.service” for details.
ubuntu@instance-test:~$ sudo systemctl status pure-ftpd
× pure-ftpd.service
Loaded: loaded (/etc/init.d/pure-ftpd; generated)
Active: failed (Result: exit-code) since Tue 2022-12-13 07:30:06 UTC; 44s >
Docs: man:systemd-sysv-generator(8)
Process: 4761 ExecStart=/etc/init.d/pure-ftpd start (code=exited, status=2)
CPU: 88ms

Dec 13 07:30:06 instance-test systemd[1]: Starting pure-ftpd.service…
Dec 13 07:30:06 instance-test pure-ftpd[4761]: Starting ftp server:
Dec 13 07:30:06 instance-test pure-ftpd[4769]: /usr/sbin/pure-ftpd-wrapper: Cou>
Dec 13 07:30:06 instance-test systemd[1]: pure-ftpd.service: Control process ex>
Dec 13 07:30:06 instance-test systemd[1]: pure-ftpd.service: Failed with result>
Dec 13 07:30:06 instance-test systemd[1]: Failed to start pure-ftpd.service.
lines 1-13/13 (END)

I have tried on test server it wierd because it worked previously but here is what i have done and it worked:

sudo service pure-ftpd stop
sudo apt-get autoremove pure-ftpd
sudo apt-get purge pure-ftpd
sudo rm -r /etc/pure-ftpd
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)

COmpletely remove all traces of ftp or pureftpd from your server.

Just install vsftp for a secure ftp if you dont care about managing users on a dashboard

sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh)

You will access ftp with user ftpuser and the password you create during the process. This user will access /home/

You can create other users by running:

# usercreatedoncyberP managed mydomain.com
sudo usermod -d /home/mydomain.com usercreatedoncyberP
sudo chown usercreatedoncyberP:usercreatedoncyberP /home/mydomain.com/public_html

I use this method on several servers and it works. Just used in test server and it works. Good luck

I tried to install vsftp and I got error message ftpuser already exsits. So I ran command sudo deluser --remove-home ftpuser. Then I tried to install again. But I am getting error message cannot create /etc/ssh/sshd_config: Permission denied. failed

ubuntu@instance-test:~$ sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1047 100 1047 0 0 4246 0 --:–:-- --:–:-- --:–:-- 4256

Install Very secure FTP daemon …

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following NEW packages will be installed:
vsftpd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 123 kB of archives.
After this operation, 326 kB of additional disk space will be used.
Get:1 Index of /ubuntu jammy/main amd64 vsftpd amd64 3.0.5-0ubuntu1 [123 kB]
Fetched 123 kB in 1s (210 kB/s)
Preconfiguring packages …
Can’t exec “/tmp/vsftpd.config.IWUHne”: Permission denied at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178.
open2: exec of /tmp/vsftpd.config.IWUHne configure failed: Permission denied at /usr/share/perl5/Debconf/ConfModule.pm line 59.
Selecting previously unselected package vsftpd.
(Reading database … 127830 files and directories currently installed.)
Preparing to unpack …/vsftpd_3.0.5-0ubuntu1_amd64.deb …
Unpacking vsftpd (3.0.5-0ubuntu1) …
Setting up vsftpd (3.0.5-0ubuntu1) …
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /lib/systemd/system/vsftpd.service.
Processing triggers for man-db (2.10.2-1) …
Scanning processes…
Scanning linux images…

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
adduser: The user `ftpuser’ already exists.
failed

ubuntu@instance-test:~$ sudo deluser --remove-home ftpuser
Looking for files to backup/remove …
Removing user ftpuser' ... Warning: group ftpgroup’ has no more members.
Done.
ubuntu@instance-test:~$ sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1047 100 1047 0 0 5694 0 --:–:-- --:–:-- --:–:-- 5721

Install Very secure FTP daemon …

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
vsftpd is already the newest version (3.0.5-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Adding user ftpuser' ... Adding new group ftpuser’ (1005) …
Adding new user ftpuser' (1005) with group ftpuser’ …
Creating home directory /home/ftpuser' ... Copying files from /etc/skel’ …
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for ftpuser
Enter the new value, or press ENTER for the default
Full Name :
Room Number :
Work Phone :
Home Phone :
Other :
Is the information correct? [Y/n] Y
/dev/fd/63: 13: cannot create /etc/ssh/sshd_config: Permission denied
failed

Seems you did not completely remove all traces of ftp on your server

sudo killall -u ftpuser
sudo userdel -f ftpuser
sudo groupdel ftpgroup

Then run the script. Am still running my vsftpd with no errors.

I should probably add a way of completely deleting pure-ftpd on the script makes it easier.

EDIT: improved the script to wipe out the user, group, all traces of pure-ftpd and install vsftpd

The script stopped running and it gave me error message. " cannot remove ‘/etc/pure-ftpd’: No such file or directory failed"

ubuntu@instance-test:~$ sudo killall -u ftpuser
ubuntu@instance-test:~$ sudo userdel -f ftpuser
ubuntu@instance-test:~$ sudo groupdel ftpgroup
ubuntu@instance-test:~$ sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1292 100 1292 0 0 5598 0 --:–:-- --:–:-- --:–:-- 5617

Remove pure-ftpd …

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package ‘pure-ftpd’ is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package ‘pure-ftpd’ is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
rm: cannot remove ‘/etc/pure-ftpd’: No such file or directory
failed

Yes rerun it on another server and got that error cause its supposed to stop if anything fails. Just added conditions however you can just run the commands here as i try to improve it for everyone

sudo apt-get autoremove pure-ftpd -y
sudo apt-get purge pure-ftpd -y
sudo rm -r /etc/pure-ftpd
sudo killall -u ftpuser
sudo userdel -f ftpuser
sudo groupdel ftpgroup
sudo apt install vsftpd
sudo adduser ftpuser
echo "DenyUsers ftpuser" >> /etc/ssh/sshd_config
sudo service sshd restart
sudo addgroup ftpgroup
sudo usermod -d /home ftpuser
sudo usermod -g ftpgroup ftpuser
sudo chown ftpuser:ftpuser /home
sudo mv /etc/vsftpd.conf /etc/vsftpd.conf.bak
sudo nano /etc/vsftpd.conf

add the following:

listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
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
force_dot_files=YES
pasv_min_port=40000
pasv_max_port=50000
allow_writeable_chroot=YES

FInally run

sudo systemctl restart vsftpd
sudo systemctl status vsftpd

Access ftp using username ftpuser and password you chose here sudo adduser ftpuser

1 Like

Everything went well except the “echo “DenyUsers ftpuser” >> /etc/ssh/sshd_config” gave me a permission denied error.

ubuntu@instance-test:~$ sudo systemctl status vsftpd
● vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset>
Active: active (running) since Tue 2022-12-13 12:40:53 UTC; 12min ago
Process: 825 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited,>
Main PID: 826 (vsftpd)
Tasks: 1 (limit: 1076)
Memory: 1016.0K
CPU: 9ms
CGroup: /system.slice/vsftpd.service
└─826 /usr/sbin/vsftpd /etc/vsftpd.conf

Dec 13 12:40:53 instance-test systemd[1]: Starting vsftpd FTP server…
Dec 13 12:40:53 instance-test systemd[1]: Started vsftpd FTP server.
lines 1-13/13 (END)

When I try to connect through filezila, I am getting the following error message.
ftpError02

I know port 22 and 990 are open.

ftpuser can only upload files in /home/ftpuser to have users only add files at /home/somedomain.com/public_html

Add new user say you have a client at www.domain.com

sudo adduser newcustomer
sudo usermod -d /home/mydomain.com newcustomer
sudo usermod -g ftpgroup newcustomer
sudo apt install acl
setfacl -R -m u:newcustomer:rwx /home/mydomain.com
## sudo chown -R newcustomer:newcustomer /home/mydomain.com

EDIT: Allow users to see subdomains if they choose not to point them to a subdirectory inside public_html

EDIT: changing permissions should allow the owner (root/user that created website) to have same access.

Screenshot from 2022-12-13 16.01.07

Use these settings for SSL ENCRYPTED connections

Screenshot from 2022-12-13 17.34.44

Improved the script and tested it. Works as expected. Should allow you to manage /home/ftpuser you are free to add users as described here:FTP not working - 530 Login authentication failed - #25 by josephgodwinke

In ssh terminal run:

sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/install_vsftpd.sh)

Incase of any issues with ssl/tls and you would rather live without it do the following:

sudo nano /etc/vsftpd/vsftpd.conf
# remove the following
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1_1=YES
ssl_tlsv1_2=YES
ssl_tlsv1=NO
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=YES
ssl_ciphers=HIGH
rsa_cert_file=/etc/ssl/certs/vsftpd.crt
rsa_private_key_file=/etc/ssl/private/vsftpd.key

Restart vsftpd service

after these steps, i cheked pure-ftpd status and looks like works correctly, but when i try to login from filezilla:

  1. when generated new one pure-ftpd.pem file:
    openssl req -newkey rsa:1024 -new -nodes -x509 -days 3650 -subj “/C=US/ST=Denial/L=Springfield/O=Dis/CN=example.com” -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

error:
00:21:08 Status: Resolving address of example.com
00:21:08 Status: Connecting to xx.xx.xxx.xxx:21…
00:21:08 Status: Connection attempt failed with “ECONNREFUSED - Connection refused by server”.
00:21:08 Error: Could not connect to server

  1. when i used original pure-ftpd.pem file after Cyber Panel installation:

error:
Host: example.com:21 hostname does not match certificate

what can i do?

Did you ever figure this out? I am having the exact same issue. Running Cyperpanel 2.3 on a Vultr instance with Ubuntu 20.04 LTS x64 and the FTP account I create does not work. How can I test if my issue i also caused by pure-ftpd?

PS: I ran some commands I found in this and another thread and this is the output I got: