- Web hosting
- Services
- Help
Knowledge base
Configuring FTP Without Using the ISPmanager
All Unix-based systems have a default user with full access and control privilege - the root superuser. However, the root user is unable to use an FTP-based connection for security reasons. Therefore, you will need to create a new user for the FTP connections. If you do not have the ISPmanager control panel, you can set this up by following these recommendations:
For example, to connect to a server via SSH, use the Windows-based Putty client.
When connecting, enter your credentials (root username and password); the password will not display on the command line.
If proftpd is not installed, run the following command to install it:
apt install proftpd - Debian/Ubuntu yum install proftpd - CentOS
Enter "Y" when prompted to confirm the file uploads.
If installation is completed successfully, "Complete!" appears in the command line.
Use the command:
systemctl proftpd start
to run the ftp service.
After installing proftpd, the proftpd.conf configuration file is created for this program
The location varies for different operating systems. They are as follows:
/etc/proftpd/proftpd.conf - Debian /etc/proftpd.conf - Ubuntu /etc/proftpd.conf - CentOS
Add an allow rule for the firewall. Add and save the rules depending on the utility you are using.
Iptables:
iptables -I INPUT -p tcp -m tcp --dport 21 -j ACCEPT systemctl iptables save
utf:
ufw allow 21 / tcp or ufw allow ftp
firewalld:
firewall-cmd --permanent --zone = public --add-port = 21 / tcp firewall-cmd --reload
Create new users for ftp-based operation.
Preemptively deny them access to the command shell for security reasons using the command:
echo '/bin/false' >> /etc/shells
If a specific needs access to the shell, navigate to the existing shell:
echo '/bin/sh' >> /etc/shells
To create a new user, run the command:
useradd user3 -d /home/user3 -m where user3 is the new user name; /home/user3 is the home directory; -the m option is used to create a new home directory.
Set a password for the new user using the command:
passwd user3
With root privileges, you can disable ftp entry to the directory for any user using the command:
chmod 555 /home/user3 where user3 is the username; /home/user3 is the directory to which entry should be disabled.
Create a directory for entry in the user’s home folder using the command:
mkdir /home/user3/upload
Grant user3 write privilege for the /home/user3/upload folder using the command:
chown user3:user3 /home/user3/upload