How to create ftp server for upload a file

Configuring to create ftp server for uploading a file

Create FTP Server For upload the files in the ftp server the steps are:

Read Also: FTP Server Details

Configure or Create ftp server for Downloading file

 

  • Step1: Create an upload dir in the document root of ftp server i.e., /var/ftp

#mkdir upload

 

 

Step2: Change the group to “ftp” and write permission to the “upload” directory 

  • Changing the group of upload to ftp

#chgrp <group name> <directory name>

#chgrp ftp upload

 

  • Adding the write permission to upload directory

#chmod g+w upload

 

  • Step3: Log Into client machine, access ftp server and try to upload same files
  • Log into client machine and access the ftp server from the directory in which the files to be uploaded are there.

 

 

Navigate upload directory and try to some files 

Once you legged into ftp and if you are not sure what is names of the files you want to upload then use “#!Is” command to see the content of the directory form which you have legged into ftp server.

 

 

“Permission denied” is because the upload Permission in the ftp configuration file is not enabled in the ftp server. So navigate to the ftp configuration file and change the following attributes in it. 

#vim/etc/vsftpd/vsftpd.conf

Uncomment (remove the #) the following line


 

 

 

  • Restart the ftp Service

#service vsftpd restart

 

  • Step4: Again login to client system and try again to upload the files into ftp server

 

 

If the SELinux is enabled in the ftp server, this error “Could not create files” Will be displayed. 

To solve above error log into server and change the following permission

  • Check the Boolean for ftp using following command

#getsebool –a I grep ftp

 

  • Make the above Boolean value as “on”
  • To Make it on use the following command

#sersebool –p allow_ftpd_anon_write on

 

 

  • Add read write permission in context of upload directory using following command

#chcon –t public_content_rw_t

 

Finally login into client machine, access the ftp server and try uploading the files in it.

 

Okay now you’ve made an ftp server for uploading files as well

 

 

One thought on “How to create ftp server for upload a file

Leave a Reply

Your email address will not be published. Required fields are marked *