Solved

Linux: Remote reboot

Posted on 2010-08-12
3
470 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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