However, both the server and the client must support passive FTP mode for this process to work. However, the passive ports must be allowed in the server firewall. The Vsftpd uses active mode by default on ports – 20 / 21 to communicate if you want to set up passive mode as well which works if there is some firewall issue between the client and server. Well, to access the FTP server using the users you have created and available on your system, you can look for a line given below in Vsftpd config file on Ubuntu 22.04: However, due to any reason, if you want to enable it then find a line- anonymous_enable= No and change NO to YES. ( optional) By default due to security reasons, nobody can log in to the FTP server anonymously (without using a valid user). Nevertheless, the most important settings are explained below. Configuring VSFTPD on Ubuntu 22.04Īfter installation, the configuration file /etc/nf must be adapted to your own needs with an editor. Now to test, let’s a create demo file inside the upload folder: echo "My FTP Server" | sudo tee /home/ h2smedia/ftp/upload/demo.txtįinally, check the permission for the FTP directory: sudo ls -la /home/ h2smedia/ftp 6. Sudo chown h2smedia: h2smedia /home/ h2smedia/ftp/upload Note: Don’t forget to Replace h2smedia with your created user. Therefore, we create a root directory for a user named- FTP under the user’s home that will act as chroot, and inside that, there will be another directory known as upload to hold the files. Yet, there is one more problem, it is VSFTPD will not allow a user to connect to the FTP server if the home directory is writable. However, to restrict the user’s access to only some specific directory vsftpd uses chroot that we also need to enable, which we do later in this article. Now, let’s create a folder under the home directory of the newly created user so that the user can only access that to upload and download files. The above command will also ask you to set the password for the user. Note: Change h2smedia with whatever name you want to give to your user. Let’s create a user that will not have sudo access and we only use it to access a specific folder under its home directory for FTP to read and write files. Once the installation is completed, let’s check the service of this FTP server is running in the background without producing any errors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |