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
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
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
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
after these steps, i cheked pure-ftpd status and looks like works correctly, but when i try to login from filezilla:
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
when i used original pure-ftpd.pem file after Cyber Panel installation:
error:
Host: example.com:21 hostname does not match certificate
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:
root@aa:~# journalctl -u pure-ftpd --no-pager |sed -e "s|$(hostname)|hostname|g"
-- No entries --
root@aa:~# systemctl status pure-ftpd.service
Unit pure-ftpd.service could not be found.
root@aa:~#
root@aa:~# sudo killall -u ftpuser
root@aa:~# sudo userdel -f ftpuser
root@aa:~# sudo groupdel ftpgroup
root@aa:~# 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 3140 100 3140 0 0 6157 0 --:--:-- --:--:-- --:--:-- 6168
Remove pure-ftpd ...
/dev/fd/63: 18: pure-ftpd: not found
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 5 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 5 not upgraded.
ls: cannot access '/etc/pure-ftpd': No such file or directory
Cannot find user ftpuser
failed
As a workaround and is the best secure way to transfer files - install bitvise ssh client and log into ssh on the top you will see tabs to swicth to sFTP do it. It should work. This is current workaround most people are using.
Youc an use any other client like cyberduck but bitvise is what I have tested and setup for people multiple times.