While working on redis server, I come to know there is an option to rename you scracy command to avoid accidental update. Is there any option for bash i.e., Ubuntu Linux especially shutdown, rm and reboot commands. While Googleing, I have found some options such as update .bashrc etc., but I want a global way, as there can be many users or one can edit his .bashrc file.
shutdown, rm and reboot commands
rm is required for a POSIX environment. If you don't want a user to delete a file, remove their write permission on the directory containing it, and don't give them root user access.
one can edit his .bashrc file
If you are going to launch a captive menu or restricted environment, don't allow users to edit their .profile or .bashrc files. Instead, via ssh access, the more secure way to force someone to only run one command is with
To prevent any user from rebooting until it is "unlocked", consider altering systemd services to insert a dependency that is not met. An example implementation is in the RHEL KB: systemd: How to prevent root from rebooting until a prescribed action is taken and there is another implementation called reboot-guard.
If polkit is in use, which it probably is for a GUI, an alternative is writing rules to supress events like "org.freedesktop.consolekit.system.restart" for not privileged users.
If your users can run in a restricted environment, force them to use a container or chroot for everything. You have to provide the software environment here, so it isn't global to the host. But it is isolated.
Don't modify system command directly. avoiding such conflicts, you create alias for shutdown command.
$ sudo vi .bashrc
[save and exit]
$ . .bashrc