sudoers file configuration
Hi everybody,
My name is kranti. I am trying to learn about sudoers file. I wanted to ask the following questions: 1. How to create command aliases for printing,shutdown,reboot and kill commands 2. I have a username called "kranti" on my debian system. I created a user alias called "SYSADMS" for which I assigned the username "kranti" in the following way: "User_Alias SYSADMS = kranti" How to make the changes in such a way that the users with alias SYSADMS will not require any password for sudo. How to make changes in such a way that SYSADMS will have sudo access but with passwords. 3. I have two groups in my system "tech" and "mang" and a user called "meltechmang001" who belongs to both the groups "tech and mang" . I have to modify or add the sudoers file in such a way that the user "meltechmang001" is only able to execute reboot and kill commands and nothing else. May I request you for step by step instructions. THANKS IN ADVANCE. |
did you look at the examples in man sudoers ?
the examples are pretty good at showing how to configure the sudoers file to do pretty much anything you want.. |
Sudoers is all about the order you do stuff in. This is my sudoers from a while ago.
# sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification Cmnd_Alias SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, /usr/bin/bash \ /usr/local/bin/tcsh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/tcsh, \ /usr/bin/zsh Cmnd_Alias RESTRICT = /usr/sbin/init, /usr/sbin/shutdown, /usr/bin/passwd, /sbin/su, \ /usr/sbin/pkgadd, /usr/sbin/pkgrm, SHELLS # Defaults specification Defaults logfile=/var/log/sudolog # Runas alias specification # User privilege specification root ALL=(ALL) SETENV: ALL exlibris libtest2=(ALL) ALL #,!RESTRICT aleph libtest2=(ALL) ALL,!RESTRICT uraa081 libtest2=(ALL) ALL upaa059 libtest2=(ALL) ALL uhye001 libtest2=(ALL) ALL,!SHELLS uqab025 libtest2=(ALL) ALL,!SHELLS |
All times are GMT -5. The time now is 05:03 PM. |