I have a VMWare VM that directly accesses some disks. In order to run (without running vmware as su which has its own problems) I need to change the ownership of the devices. I've done this manually using Nemo, so I know what needs to be performed.
Writing a shell script to do this, I wrote
chown john:john /dev/disk/by-id/blahblah /dev/anotherblah /dev/lastoneblah
I saved it as a file
drive-owner, set the execute bit, then in a root shell changed its owner to root and set the +s special mode flag.
The result, according to ls, is
If I run that from a normal (non-root) shell, I get errors from chown, Operation not permitted. It runs without complaint from a root shell.
I seem to be missing the part that runs the script as root automatically. I thought that was the purpose and function of the "setuid" permission, and +s is how to specify it.
What am I missing?