Configuring the ftp server for uploading a file
To upload the files in the ftp server the steps are:
Step1: Create an upload dir in the document root of ftp server i.e., /var/ftp #mkdir upload
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
and access the ftp server from the directory in which the files to be uploaded are there.
Navigate to upload directory and try to upload some files Once you logged into ftp and if you are not sure
what is names of the files you want to upload then use “#!ls” command to see the content of the directory
from which you have logged 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
Anon_upload_enable=yes
Start and enable service
If the SELinux is enabled in the ftp server, this error “Could not Create file” will be displayed. To solve
following command #getsebool –a |grep ftp
Allow_ftpd_anon_write-- on
Add read write permission in context of upload directory using following command
#chcon -t public_content_rw_t
To Allow the root access to ftp server edit the “/etc/vsftpd/user_list” and “/etc/vsftpd/ftpuser” and just add
the comment (#mark) before “root” #vim /etc/vsftpd/user_list
Change the Boolean value to on for ftp_home_dir by following command #setsebool –P ftp_home_dir on
0-65535
1-1023
1024 -65535