Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 11-03-2008, 05:03 PM   #1
LQ Newbie
Registered: Oct 2008
Posts: 12

Rep: Reputation: 0
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.

Old 11-03-2008, 09:36 PM   #2
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
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..
Old 11-04-2008, 03:10 AM   #3
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36
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, \
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
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create two entries for the sudoers configuration file - help! SheMoves Linux - Newbie 1 06-23-2008 01:30 PM
Sudoers File Help Harlin Linux - Software 1 03-15-2006 04:16 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
Entries for sudoers configuration file Hikito Linux - Newbie 5 09-17-2004 12:42 PM
help with sudoers file ogden2k Linux - Security 4 03-11-2003 10:39 AM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration