Is there a way to know the permissions for a given user (which is not the current user) for a specific file on Linux?
My question assume not switching user with su
.
Is there a way to know the permissions for a given user (which is not the current user) for a specific file on Linux?
My question assume not switching user with su
.
This commands return 0, if youruser can read (-r), write (-w) or execute (-x) file or it returns 1 if youruser can't read, write or execute.
sudo -u youruser test -r /path/to/file
sudo -u youruser test -w /path/to/file
sudo -u youruser test -x /path/to/file