let's say I want one of the non-root users named "Alex" to only allow to shutdown command but with the restriction like, he can only shutdown after minimum of 120 min and no delay more than 1000mins. Basically, to set upper limit and lower limit for executing the shutdown command. To add on I am using Rocky Linux 9.
set upper limit and lower limit in time for user before executing shutdown command in linux
145 Views Asked by Kevin Chotaliya At
1
There are 1 best solutions below
Related Questions in LINUX
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in SUDO
- macOS - Most secure way of a GUI SUDO_ASKPASS
- How to fix npm errors without writing sudo in macOS?
- Is it possible for `sudo` to fail temporarily with the correct password? Hacking suspected
- I can’t run 'sudo apt install' on macOS even though Java is installed
- sudo command behaviour difference with the -i flag
- Homebrew with sudo parameters for special packages
- PgAdmin Connection Error: "getaddrinfo ENOTFOUND postgresdb" (Docker Compose)
- How to run sudo visudo in a Dockerfile?
- ERROR: failed to solve: process "/bin/sh -c apt-get update"
- Dockerfile (docker container) sudo password error
- Facing an error while updating my Ubuntu. showing that I am missing a file
- VSCode remote debug raspberry pi with pigpio needs sudo
- How can I execute a sudo command in a macOS app and persist root user privileges?
- Ansible: Missing sudo password after setting nopasswd - Cache or something?
- Apple Script to run an application as root (Part 2)
Related Questions in SHUTDOWN
- Unexpected OS Shutdown
- weblogic abruptly stopped during deployment with fatal error
- Error message on shutdown - from unshown winform
- Metatrader 5 closes after initialization
- How can I find out when the computer shuts down after executing the shutdown command?
- Timing issue while looping over the testing tool command line process
- Android Dumpsys - How to obtain power on/off data from a year ago
- Close Tauri window without closing the entire app
- What is the most appropriate way to shutdown the host system from within docker
- MariaDB always displays message Erorr:MySQL shutdown unexpectedly
- Get last Windows/PC shutdown time with VBA
- Preventing DLLHost Process Shutdown or Keeping Explorer Window Responsive during Long-Running IExplorerCommand::Invoke Operation in C++
- Will my heroku app be affected by adminium shutdown?
- In Swift on macOS, how can I properly catch the powerdown event from NotificationCenter?
- Powershell Script - Shutdown PC after set idle time
Related Questions in SUDOERS
- Ansible - install yum packages with preconfigured sudoers privileges
- "Missing sudo password" error with Ansible Error
- requiretty is being added to a user permissions by default in centos 7
- Jenkins permission denied when i am copying my index.html file to /var/www/html
- Deleting content of "/var/log/sudo-io"
- Is there a way to whitelist a set of normal commands and block usage of any commands outside of that?
- Ansible failing to execute the command by becoming super user?
- Visudo for multiple files in directory
- How to give list of commands that a user can sudo into as a script/executable in sudoers?
- How to edit /etc/sudoers file from a golang application safely?
- How to execute bash script by zabbix agent using sudo?
- In Debian, visudo /etc/sudoers
- Raspberry Pi: ACL on ramfs?
- Run ansible as root with specific sudoers
- How to write a Chef Inspec test for the Chef Infra 'sudo' resource?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can:
shutdownC source code, modify it to check if the user is Alex, and if so, check the required time range. Then compile this source code to a program named likemy_shutdown, install it to/usr/local/binNOPASSWDfor alex in sudoersNOPASSWDto sudoers, likealex ALL=NOPASSWD: shutdown 120m,... 121m... 122metc. for every combination of arguments you want to supportshutdownexecutable. And add that wrapper into sudoers, or add SUID on it. Strongly consider not using a scripting language - for example, with python with anyimportand by manipulating PYTHONPATH environment variable, the user will be able to execute any code as root.