I have a script:
[postgres@LaHarch ~]$ cat mkrundir.sh
#!/bin/bash
mkdir /run/postresql
With attributes:
[postgres@LaHarch ~]$ ll mkrundir.sh
-rwsr-sr-x 1 root root 74 Aug 26 18:53 mkrundir.sh
But when I run it I get:
[postgres@LaHarch ~]$ ./mkrundir.sh
mkdir: cannot create directory '/run/postresql': Permission denied
Why SUID didn't help me? And what is best practice for such a task?
sudo
). – peterh Aug 27 '19 at 08:28