LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 09-13-2006, 01:13 PM   #1
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
leting users shutdown form the comand line


what is the best way to let normal users run the shutdown command form, the comanmd line in 10.1

curently normal users can only shutdown with the GUI form KDE but i want to create a shell script that shuts other things down first before halting the system
 
Old 09-13-2006, 01:18 PM   #2
hockeyman_102
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Suse, CentOS, Ubuntu
Posts: 124

Rep: Reputation: 15
like?
shutdown -h now
you may have to have su privlages for that - not sure.
 
Old 09-13-2006, 01:21 PM   #3
XaViaR
Member
 
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Rep: Reputation: 31
I would install sudo and add the following entry:

as root: visudo
add:

%users localhost=/sbin/shutdown -h now

To run this in a script do:

# -- Start of Script --

#!/bin/bash

#--------------------------------------------
# allows users to shutdown the system
#-------------------------------------------

# shutdown the system
sudo /sbin/shudown -h now

# -- EOF --

# -- End of Script --

chmod 0755 nameofscript.sh

Last edited by XaViaR; 09-13-2006 at 01:25 PM.
 
  


Reply


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
long comand line script i think pigswillfly Programming 1 04-02-2006 08:05 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 10:27 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM
How do I detach a process from the comand line? Joey.Dale Linux - General 3 02-29-2004 09:46 AM
Help w/comand line dolvmin Linux - Software 2 09-23-2003 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 12:49 PM.

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