Solved

Linux: Remote reboot

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 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

22 Experts available now in Live!

Get 1:1 Help Now