write config and keys with umask 0077