Wednesday, April 24, 2019

sftp - Correctly setting user permissions via SSH

I'm getting stuck with user permissions on a LAMP stack (using Digital Ocean if it matters). Here's my setup.




User dev has the following groups:
dev www-data



The /var/www folder has been set so that the owner is www-data:www-data, it looks like this:



 drwxrwxr-x  3 www-data www-data 4096 Mar 30 17:41 www


If I use the dev user to sftp in, everything looks good, but if I then upload a file, the new file has the ownership of dev:dev.




This becomes a problem when I have a new user called dev2 that is also working in the same directory as they can't delete or overwrite the files that belong to dev.



My experience with users is unfortunately limited to using cPanel, where I can create multiple FTP users that don't have this access/overlap issue. How can I do this via terminal?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...