LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 06-19-2007, 01:36 AM   #1
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Rep: Reputation: 15
shutdown linux via scripts from windows


hello guys,
I would like to ask for help on this:
I have a UPS(powerware) connected to windows, I want to create a script that will shutdown my linux (redhat) when theres a power failure. Power ware does not have a system monitoring for linux, so my windows box is connecvted to ups and Windows will trigger the scripts during the power failure.

Thank you and best regards to all,
westverg
 
Old 06-21-2007, 12:46 AM   #2
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Original Poster
Rep: Reputation: 15
ok I got it used Plink and I able to login without typing username and password.
but my command does not execute: command I used

c:\plink 10.11.11.1 -l username -pw password /sbin/shutdown -r
it says "Access Denied"

Can you help me guys...

Thanks
 
Old 06-21-2007, 03:33 AM   #3
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
yeh to run commandline shutdown you need to be root or use sudo
 
Old 06-24-2007, 11:44 PM   #4
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dasy2k1
yeh to run commandline shutdown you need to be root or use sudo
Thanks for your reply dasy2k1

the username I used is the root. I dont know why I am denied.

thanks
 
Old 06-25-2007, 12:09 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Perhaps remote root logins are disabled?
 
Old 06-25-2007, 02:55 AM   #6
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Nylex
Perhaps remote root logins are disabled?
I am using Plink I can login automatically, but If add my command
c:\plink 10.11.11.1 -l username -pw password /sbin/shutdown -r

it says access denied.

Thanks
 
Old 06-25-2007, 04:10 AM   #7
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
you need to add a time argumebnt to the shutdown prompt...

try shutdown -h now for poweroff
or shutdown -r now for reboot
 
Old 06-25-2007, 11:18 PM   #8
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dasy2k1
you need to add a time argumebnt to the shutdown prompt...

try shutdown -h now for poweroff
or shutdown -r now for reboot
same I am access denied, but if used other account, it says
"Running command is not allowed" (with shutdown -h)

If I removed the command "Shutdown -h"
it bring me to the [user@hotname]# prompt


Please help.

Thanks again
 
Old 06-26-2007, 04:12 AM   #9
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
if you have sudo set up you could try running as a user with the command suso shutdown -h now
 
Old 06-27-2007, 07:43 PM   #10
westverg
Member
 
Registered: Nov 2004
Location: Philippines
Distribution: i dont know
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dasy2k1
if you have sudo set up you could try running as a user with the command suso shutdown -h now
Thanks for your reply, I tried to login as root but I am access denied, I think
the root account is disabled to use for login, how can I enable this?

thanks again
 
Old 06-28-2007, 03:54 AM   #11
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
thats why a recomended sudo,


log in as a normal user, and run
sudo shutdown-h now
 
  


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
KDE shutdown scripts Crobat Linux - General 8 05-23-2007 01:03 AM
Writing Scripts for Linux in Windows AxXium Linux - General 4 07-18-2005 04:01 PM
shutdown scripts? mushmaster Linux - Software 5 02-15-2005 06:23 PM
Emergency Shutdown scripts? samroberts Linux - Enterprise 3 10-29-2004 04:48 AM
Where do you place shutdown scripts? zer0halo Linux - Newbie 3 08-24-2004 03:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 08:03 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
Open Source Consulting | Domain Registration