Telnet/ssh into a windows machine inside putty that is sshed to a linux machine

2

I am on a Windows machine. I SSH into a Linux machine using Putty. This works fine. However, I have a bunch of make commands I have to execute and move files around. So, I am trying to automate it. Part of the build I have to VNC into another Windows machine and run a make command there. Then when that is done I finish the build in Linux.

Is there a way that I can Telnet/SSH into that Linux machine so I can just send a couple make commands and continue the build process in Linux (I cannot install new software on that Windows machine)?

I just have a big long list of commands combined with && (cmd1 && cmd2 && .. cmdn). I just want to be able to type a command to get into the Windows machine and then type a command to get out from inside Putty.

ageoff

Posted 2012-05-23T21:16:17.707

Reputation: 125

Do you mean telnet into the window's machine? – nsfyn55 – 2012-05-23T21:24:24.333

@nsfyn55 Yes. I am on windows but i use putty to my linux machine and need to telnet from the putty into a different windows machine. windows1->linux->windows2 – None – 2012-05-23T21:31:32.053

read below. You have to have a daemon running. When you ssh to port 22 on a linux box the reason you are able to connect is because sshd is running and has a socket bound to that port. If you have no such process on your windows box then you are out of luck – nsfyn55 – 2012-05-23T21:53:37.680

Answers

3

First, you can use Task Scheduler to create a task to do the build step on the Windows machine. This will avoid having to VNC into the windows machine.

Secondly, you can us PLINK (included with PuTTY) to easily automate PuTTY, and run your Linux build steps.

With these two bits of information, hopefully you can write a completely automated build script to meet your scenario.

I hope this helps.

Ben

Posted 2012-05-23T21:16:17.707

Reputation: 1 406

This would work great but when i build its not a scheduled thing. Its more of a i just created a new feature and i need to build to make sure i didnt break anything. So i just copy and paste the big long list of commands and it builds. Although i will look into PLINK as i have not heard of that. – None – 2012-05-23T21:30:04.143

1

Scheduled tasks don't have to be scheduled. You can create a task which (say) runs a batch file, then you can start it remotely using SCHTASKS.EXE. See my answer on this question: http://stackoverflow.com/questions/6178437/start-remote-process-within-the-context/8818377#8818377

– Ben – 2012-05-23T21:35:05.823

1

You can rsh/ssh into any machine that is running a rsh or ssh daemon process. On windows the go-to is the OpenSSH package that comes with cygwin. The short answer is if you don't have a daemon installed and you can't install one then no you can't ssh in.

nsfyn55

Posted 2012-05-23T21:16:17.707

Reputation: 173

0

How about a script? I haven't yet tried putty for this. But this link gives an example http://fixunix.com/ssh/253629-how-pass-command-script-remote-computer-over-putty-ssh-execute.html and this one discusses a similar thing Call putty/plink to start a remote SSH linux script with user input so involves plink.

And you clarified your question with this comment.

 I am on windows but i use putty to my linux machine and need to telnet from the putty into a different windows machine. windows1->linux->windows2 – LiverpoolFTW

For the cygwin openssh ssh.exe client i've tried running a command, and I suppose one can do a script too. Give it a try. You can do ssh linux rr <-- that'd run script rr which resides on your linux machine, and that script would run ssh windows2 rt.bat that's also kind of like winding up. Then they'd unwind. rt.bat would complete, and then it'd come out of windows2, and go to linux, complete any more of the linux script then when the linux script completes it'd return and go to the windows that you started from. For Putty you might still need plink, but those links give examples.

barlop

Posted 2012-05-23T21:16:17.707

Reputation: 18 677