Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com May 24 '12 at 8:52

This question came from our site for professional and enthusiast programmers.

    
Do you mean telnet into the window's machine? –  nsfyn55 May 23 '12 at 21:24
    
@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 –  LiverpoolFTW May 23 '12 at 21:31
    
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 May 23 '12 at 21:53

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer
    
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. –  LiverpoolFTW May 23 '12 at 21:30
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: stackoverflow.com/questions/6178437/… –  Ben May 23 '12 at 21:35

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.