Go Back   Computer Forums > General Computing > Server Administration
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 04-20-2011, 04:26 PM   #1
In Runtime
Join Date: Jan 2011
Posts: 277
Default How to run a command without using sudo password in ubuntu?

Today I have tried my client PC run shutdown and reboot command without being enter sudo password. The details given below

Use the command “sudo visudo” to edit the file. Now look for the line “# User alias specification” and add a list of users as follows:#
User alias specificationUser_Alias USERS = user1, user2, user3

Now look for the line “# Cmnd alias specification” and add a command list as follows:

# Cmnd alias specificationCmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt

Now look for the line “%admin ALL=(ALL) ALL” and add the command which will let USERS give SHUTDOWN_CMDS without a password


Now those specified users can use the commands “sudo shutdown”, “sudo halt”, and “sudo reboot” without being asked for your password.

EDIT: By the way, the reason that these commands can’t be used by normal users is that Linux was designed as a multi-user system. You don’t want one user shutting down the system while others are using it!
sahabcse is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 05:01 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0