gpg: WARNING: unsafe ownership on configuration file, $gpg –fingerprint on Ubuntu9.10

Commands run with sudo will be run as root. What you want to do is to own the files as your user dylan, right? Maybe so happens that root is owning your files now. This can be changed by: sudo chown -R dylan ~dylan/.gnupg and then as dylan: chmod 600 ~/.gnupg/gpg.conf chmod 700 ~/.gnupg To … Read more

Permission issue with PostgreSQL in docker container

The other answer indeed points to the root cause of the problem, however the help page it points to does not contain a solution. Here is what I came up with to make this work for me: start the container using your normal docker-compose file, this creates the directory with the hardcoded uid:gid (999:999) version: … Read more

How to set a files owner in python?

os.chown(path, uid, gid) http://docs.python.org/library/os.html The uid and gid can be retrieved from a string by import pwd import grp import os uid = pwd.getpwnam(“nobody”).pw_uid gid = grp.getgrnam(“nogroup”).gr_gid Reference: How to change the user and group permissions for a directory, by name?