Currently, I do sudo chown -R ubuntu:ubuntu /home/ubuntu/<folder>
.
But, when I run a Python script which would be creating a folder named testoutput
and write files to it, the folder is created with the root
permissions, and hence, getting permission denied
error while writing files to the folder.
How do I ensure that even new files in the range get the same permissions when doing chown
? Is there a way to ensure that in Ubuntu?
The permissions of the new folder i :
drwxr-xr-x 2 root root
while the permission of the existing folders is:
drwxrwxr-x 2 ubuntu ubuntu