pm-suspend must be run by root:
he@x22:~/hep/links$ /usr/sbin/pm-suspend
This utility may only be run by the root user.
I made a link, pms:
he@x22:~/hep/links$ ls -l pms
lrwxrwxrwx 1 he he 20 dec 17 22:13 pms -> /usr/sbin/pm-suspend
and as expected:
he@x22:~/hep/links$ ./pms
This utility may only be run by the root user.
but if I change directory and adds ~/hep/links to the path it works for a normal user:
he@x22:~$ pms
whoami root
To see who the effective user is, at the top of /usr/sbin/pm-suspend I inserted:
#!/bin/sh
echo whoami $(whoami)
.....
root@x22:/home/he/hep/scripts# type -a pms
pms är ett alias för ”sudo pm-suspend”
pms är /home/he/hep/scripts/pms
pms är /home/he/hep/links/pms
Can someone, please, explain what is happening here?