Reputation: 125
I am running Debian 6 - 64-bit and I am looking to put specific set of permissions on one of a executable binary file.
The file is originally owned by user/group root and holds 0111 set of permissions that only allows execute permissions.
I have set these permissions because I usually do installs for every user I create and this file is automatically copied to the user's home directory when the files are installed. The file is important so I do not want those created users to download or even view the file over FTP, the only thing they are allowed to do is execute.
But since I've set 0111 permissions on the file to achieve what I want, the file is no longer copied to the user's home directory because root cannot read/write the file. What should I do that would still allow root to read/write the file so it is copied over to user's home directory in the automated process but disallow the created user from accessing it. The file is owned by user/group root and after it is copied, it is owned by user/group new-user.
Upvotes: 0
Views: 2061
Reputation: 363587
Set the permissions of the original to 511 or 711 (o+r
), then before the copy, do umask 666
to remove these permissions from newly created files. The copy will then have permissions 0711 & ~0666 == 0111
.
Upvotes: 3