I have a really basic confusion. How does
I noticed that when I ran a script it failed, since it tried to write a file in a directory that the following permissions:
$ ls -l thedir drwxr--r-- usr grp
But when I run the script as
sudo -u usr it worked.
If I am able to do run the script successfully with sudo, why did the script fail in the first place?
I mean if I have enough rights to run as that user I should be able to run the script succesully in the first place, I guess.