Automatically assign user and group to new files

azurtem

New Member
Credits
0
Hi

I noticed that with my ISP whatever file I create via SSH or FTP is automatically assigned a user and group

My current setup is the following : Windows Server 2019 Essentials, WSL, Ubuntu 18.04 and vsftpd

I have toyed around with the vsftpd config and linux user/group permissions in order to obtain the same result but so far all I have achieved is to impose a common group for all copied or created files

What is the trick to updating the actual owner of the files ?

Thanks
yann
 


TechnoJunky

Well-Known Member
Credits
314
I don't do a lot of FTP'ing so not sure how file permissions are handled with that, but you can set up the permissions at the directory level and all files in the directory will be what you want by permission enforcement. 99% of the time, when you see file or directory permissions you see 3 digits, 755, 750, etc. There's actually a forth one, prefixing the other 3. When left out, it's defaulted to 0, 0755. However, you can change the enforcement by changing that number. see below for what each number represents:

0 = nothing being enforced
1 = only the owner/creator of the file (or admin) can delete the file he/she created. This "1" is commonly referred to as "sticky bit"
2 = maintains the GID permissions set at the directory level, files created won't inherit the creators GID. This "2" is commonly referred to as "setgid"
4 = maintains the UID permissions set at the directory level, files created won't inherit the creators UID. This "4" is commonly referred to as "setuid"

Just like the 'regular' 3 digits, this forth can have the numbers can be stacked to do multiple options. So if you want setUid and setGid, they add up to 6, so permissions 6755.
 


Members online


Top