Solved

Linux: Remote reboot

Posted on 2010-08-12
3
468 Views
Last Modified: 2013-11-15
Hi there,

I need to make a Windows Batch File that will reboot a linux machine running Ubuntu 10.04 LTS

admin username=whatever
password=everwhat
ip=192.168.1.5

Could you please provide me with the required command line?

Cheers,
Rene
0
Comment
Question by:ReneGe
3 Comments
 
LVL 23

Expert Comment

by:savone
ID: 33424439
This is not going to be all that easy.  If your using ssh you have two options that I know of.


1) Set key authentication so you do not get prompt for a password

2) Use an expect script to pass the password.

0
 
LVL 5

Accepted Solution

by:
group0 earned 500 total points
ID: 33425813
Get plink (PuTTY link) - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Put this in your batch file:
plink whatever@192.168.1.5 -pw everwhat < cmds.txt

cmds.txt:
/sbin/shutdown -r now

Link to the documentation - http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter7.html#plink
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33429516
Thanks group0

Cheers,
Rene
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now