remote shutdown windows from linux

  • Thread starter Thread starter diffuser78
  • Start date Start date
D

diffuser78

I have 2 windows box and one linux box. I want to shutdown the windows
box remotely from linux box.

Any ideas for the above problem ??

Every help is appreciated.

Thanks
 
The installer has a minimum set of cygwin files. I just installed it here
the other day and it works fine logging in from my Slackware box. Just setup
a group file and a passwd file (reame file) and you're good to go. I saw
your post in comp.lang.python and figured you didn't like my idea :-) Good
luck.
Louis
 
Hi,

I liked your idea and I am implementing it on my home computer.

The only problem I am having is that i get a password prompt and i dont
know the passowrd for it.

I did exactly given as in the openssh for windows installation package
but i didnt install cygwin.

ssh [email protected]
password:

Here I am stuck as whatever password i thought shuold work, it doesnt
work.

Can you suggest something out here.

I really appreciate your help,

Thanks
 
how can one know what password to use. I set that openssh for windows
setup successfully.
I remote login from linux box, it asks me password but doesnt work on
any password.

How did you do on your slackware ?
 
Any help with OpenSSH for windows and shutting it down from Linux
terminals ?

Evey help is appreciated.
 
It is working fine from my Slackware box. Did you open a command prompt in
the bin folder and "mkgroup -l >> ..\etc\group" and "mkpasswd -l >>
...\etc\passwd" as the readme says? After that you should be able to login as
any local windows user. Let me know if you are still having trouble.
Louis
 
I can now logon using password. I wanted to automate the login using
the public and private keys. So I created a pair of public and private
keys on my linux box.
I copied the .pub key on the windows box in the $HOME directory which
is C:\Document and Settings\Username.

Then I copied the .pub file in the list of authorized_keys which is
also located in the $HOME directory which is C:\Document and
Settings\Username.

Now when i login from linux box, it asks me username and password.
After giving password it logs me in. Since I wanted to automate the
procude I did the public/private keys. I want to avoid the step that it
asks me the password.

I want something like

ssh username@IP_ADDR # It will log me in
shutdown -s # shuts the computer down


Every help is appreciated.

Thanks
 
I don't use key authentication but I believe you need to store your public
key in a folder called ".ssh" (note the leading dot) inside your home
folder. You will also need to add your key to the "authorized_keys" file.
There is a document called "key_authentication.txt" in the docs folder that
explains it. Hope this helps.
Louis
 
I am doing exactly what is said in the doc and what you said but I am
not able to login using the public key.

I was just wondering if you were able to do it using public key.

Every help is greatly appreciated.

Thanks
 
Did you try step 4 from the key_authentication.txt file? I still have not
tried with my slackware box, but from a windows box, I was unable to login
using public key until I changed the value of "StrictModes" to "no" in the
"sshd.config" file and restart the openssh service. I will try from
Slackware when I get a chance.
Louis
 
I followed that step number 4 to change the modes.

Is there any other setting you have to modify in ssh_config to get it
started ?

Thanks man ,I really appreciate your help
 
No, just make sure you restart the openssh service after you make your
change. I just tested it from my Slack box and had no problem. You also want
to make sure that the home directory in your passwd file matches the home
folder where you put your ".ssh" folder. (You can tell if it is incorrect
because ssh will give you an error when you login about not finding it.) If
you need to correct it, make sure you restart the server. Make sure you have
your "authenticated_keys2" file in your .ssh folder. I'm off to the golf
course, post back if you don't get it going and I'll get back to you
tomorrow.
Louis
 
Hi,

I finally got it working to work with public keys where you dont need
to provide password at the run time.

Now, I came to my ultimate goal which was shutting it down remotely
from linux terminals.

So, I wrote a script like
Code:
ssh Admin@IP_ADDR  # connects me fine now without problems (LOCAL)
shutdown -s            # This is a windows command (REMOTE)

Now, when I run this script, it successfully logs me into the windows
box but doesn't run the second part of the script which is shut down.


Can you please tell me why ??

Eveyr help is appreciated.
 
Hi,

I finally got it working to work with public keys where you dont need
to provide password at the run time.

Now, I came to my ultimate goal which was shutting it down remotely
from linux terminals.

So, I wrote a script like
Code:
ssh Admin@IP_ADDR  # connects me fine now without problems (LOCAL)
shutdown -s            # This is a windows command (REMOTE)

Now, when I run this script, it successfully logs me into the windows
box but doesn't run the second part of the script which is shut down.


Can you please tell me why ??

Eveyr help is appreciated.

Sounds like you are close to a solution, but one passing thought....

You could also set up a dual boot on your linux box with a Windows
installation, such that you could quickly reboot to your Windows
installation and then remote desktop to your other Windows installations to
shut them down.

Jon
 
I strictly need to run the script from linux terminal and shutdown the
windows PC. I cannot even use windows to windows shutdown which is much
easier to do.

Thanks for your help.
 
I found the right way which is to have them in one line to execute
remotely.


ssh username@IP_ADDR shutdown -s


Hope this help others sometimes.
 
Perseverance! Glad you got it working. As a thought, if it is critical that
the machine shutdown completely, you may want to use the -f switch to catch
any process that might be hung.
Louis
 
Thanks Loius, I really appreciate your help You suggested me to use the
OpenSSH which was quite useful. I had trouble in between setting up
propeorly but with your help I finally got it.

I really appreciate your help.

thanks,
Daniel
 
Back
Top