![]() ![]() Ports 40000-50000 will be reserved for the range of passive ports that will eventually be set in the configuration file and port 990 will be used when TLS is enabled. In this step let's open ports 20 and 21 for FTP traffic. Sudo chown nombre-usuario:nombre-usuario /home/nombre-usuario/ftp/filesĪt this point, we will create a test file in the files folder:Įcho "vsftpd archivo de ejemplo" | sudo tee /home/nombre-usuario/ftp/files/ejemplo.txt Securing the FTP server Sudo mkdir /home/nombre-usuario/ftp/files We continue creating file container directory and we will assign the property: Now we remove the write permissions of this folder: sudo chmod a-w /home/nombre-usuario/ftp Sudo chown nobody:nogroup /home/nombre-usuario/ftp We will set the property of the folder with this other command: To begin with we create the FTP folder: sudo mkdir ftp For this example, we are going to create an ftp directory that will act as a chroot, along with a directory of modifiable files. With chroot enabled, a local user is restricted to their home directory ( default). Vsftpd uses chroot cages to achieve this. Ideally, FTP should be restricted to a specific directory for security reasons. Now we are going to set a password:Īfter we are going to move to the newly created user folder: cd /home/nombre-usuario Replaces' username'by your intended username. In the terminal (Ctrl + Alt + T) we will only have to use the command: ![]() With this We can use any FTP client to access the files hosted on the server through vsftpd. Sudo systemctl enable vsftpd FTP user account Now let's start service with the command: sudo systemctl start vsftpd If something goes wrong, the default settings can be restored. Once installed, we will start with make a copy of the original configuration file. If you don't have it installed on your computer, can be installed with the command (Ctrl + Alt + T): sudo nano /etc/vsftpd.Install an FTP server in Ubuntu Install vsftpdįor this example, I am going to install an FPT server on my local network on Ubuntu 20.04. sudo mv /etc/nf /etc/Ĭreate a new config file with Vim editor. ![]() sudo chown ftpuser:ftpuser /home/ftpuser/ftp/files Step 5 - Configure vsftpd sudo mkdir /home/ftpuser/ftp/filesĪssign ownership of this directory to our new FTP user otherwise they will not be able to write to it. Next we will create a new directory within /ftp where the user can view and upload files. Set permissions for the ftp directory using chmod so that it is not writable by anyone, otherwise vsftpd will not allow you to log in sudo chmod a-w /home/ftpuser/ftp sudo chown nobody:nogroup /home/ftpuser/ftp Set the ownership of the ftp directory to no nobody:nogroup. We want this user to upload files to the home directory, so we will create a new directory called ftp in the user’s home directory and another within it called files sudo mkdir /home/ftpuser/ftp For that reason, we have to set up some directories and permissions. Vsftpd uses chroot jails to restrict users to their home directories and requires that the home directory is not writable. You now need to decide where this new FTP user is allowed to view and upload files. You can just press ENTER to each of these. You may also be asked to enter some contact information. Generate a strong password and keep it safe. In this example, we will create a new user called ftpuser sudo adduser ftpuser We will now create a new user that we will use to log into FTP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |