Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-18-2008, 05:23 AM   #1
Registered: Feb 2006
Location: Warsaw, Poland
Distribution: Archlinux, Debian
Posts: 139

Rep: Reputation: 16
shutdown system from command line


I have a question regarding "shutdown" command.
I know how to use it, but the problem is I would like to have posibility to use it as simple user (not ROOT). I need to use it from command line, because the user is connected via OpenSSH.
I have found so far many descriptions how to allow it with CTRL+ALT+DELETE, but I need command line option!.
I am using special user for SSH session and don't like idea to provide root password during SSH session (like use "su" command).

It is possible? If yes, then how.

I am using OpenSUSE 11.

Old 08-18-2008, 05:39 AM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
You can use sudo for this. For example, you could create a group called admin, put your normal user into that group and then as root, run visudo and add an entry similar to the one below
## Allows members of the users group to shutdown this system
%admin  localhost=/sbin/shutdown -h now
Old 08-18-2008, 10:47 AM   #3
Registered: May 2008
Distribution: Arch
Posts: 47
Blog Entries: 3

Rep: Reputation: 16
here is a short guide: I hope you'll find the info that you need.
Old 08-18-2008, 01:36 PM   #4
Registered: Feb 2006
Location: Warsaw, Poland
Distribution: Archlinux, Debian
Posts: 139

Original Poster
Rep: Reputation: 16

thanks for advise.

I tried both ways and even tried another way typical for SUSE:
I have used YaST to configure /etc/sudoers.

In the beginning nothing worked :-( but I have found out what kind of mistake I have done. I tried to use shutdown command as I used to do with root - something like this:

sudo shutdown -h now
It didn't worked. I was always asked for root password, but when I entered:

sudo /sbin/shutdown -h now
everything works as expected.



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
LXer: Command Line Ticketing System LXer Syndicated Linux News 0 04-12-2008 07:40 AM
Getting System Info from command line tekmann33 Linux - Newbie 2 12-22-2006 06:10 PM
Command line system load tool? halturata Linux - Newbie 5 04-19-2006 09:00 AM
system does not boot after shutdown -h command manhar_puri Linux - Laptop and Netbook 3 08-31-2004 09:25 PM
How to get list of system users from command line? tictocdoc Linux - General 3 03-12-2004 04:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:28 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration