How to change permission of files while uploading


I didn’t work so much about FTP server configuration but today one of our customer wanted to create limited FTP user who just gonna upload image files to server and after that another script going to fetch fetch all files for another main directory of web server. (Nobody believes each other 🙂 )

So what I learn today 🙂 There is an option in vsftpd.conf that changes all the files permisson as like chmod (looks like reverse of it mathematically)

For changing permission of files while uploading you have to find local_umask=XXX line and you have to change how ever you want and than you have to restart your vsftpd


To understand how umask works, I explain how umask in Linux.

So as you see we created files which has different permissions(If your eyes work well, you will realise that I’m liar) with touch command.

The reason why 111 permission and 000 permission has THE SAME permission is exception of Linux1.

And also you can change globally by changing home/anyuser/.profile or /etc/profile file for ssh option that means you can create your files different than -rw-rw-r–  or 022

check also: