Hello,
Users that aren't a member of the group wheel don't need access to /bin/sh, /bin/csh or /bin/tcsh in my opinion. In our situation I don't need this, it's a shared webserver where users can create cronjobs, users don't have shell access, but they can run a shell script from cron. In my opinion that's a security risk. I know they can't reboot/shutdown the system, or see the /etc/master.passwd and many other important files, but they can do, and find out, more than I want them to.
My simple thought was to
That gives the following error:
It runs as the operator user, I understand why this doesn't work, but I'm looking for an elegant solution. I can simply add operator to the group wheel, but I'm not aware of security issues with that. Another solution could be to make operator owner of /bin/sh, root is already a member of wheel, but again I'm not sure if this is a good solution. Last option would be to run the save-entropy as root user, but I imagine there a legitimate reason it's running as operator by default.
Users that aren't a member of the group wheel don't need access to /bin/sh, /bin/csh or /bin/tcsh in my opinion. In our situation I don't need this, it's a shared webserver where users can create cronjobs, users don't have shell access, but they can run a shell script from cron. In my opinion that's a security risk. I know they can't reboot/shutdown the system, or see the /etc/master.passwd and many other important files, but they can do, and find out, more than I want them to.
My simple thought was to
# chmod 550 /bin/sh
(and the other shells from /etc/shells. The owner and group are root:wheel. That way root can login normally and users with shell access, like myself, can login because I'm a member of wheel. This works fine as far as I can tell now, except for /usr/libexec/save-entropy from /etc/crontab:
Code:
*/11 * * * * operator /usr/libexec/save-entropy
That gives the following error:
Code:
cron: execl: couldn't exec `/bin/sh': Permission denied
It runs as the operator user, I understand why this doesn't work, but I'm looking for an elegant solution. I can simply add operator to the group wheel, but I'm not aware of security issues with that. Another solution could be to make operator owner of /bin/sh, root is already a member of wheel, but again I'm not sure if this is a good solution. Last option would be to run the save-entropy as root user, but I imagine there a legitimate reason it's running as operator by default.