Thursday, October 15, 2009

connection between two systems without using ssh

While there are a myriad ways in which you can connect two systems, my colleague happened to bring up this question

As a build and release person, what options other than ssh do you have to run your scripts remotely on another system.

Hmm " Yeh to hamne kabhi socha hi nahi" , was the first reaction from all of us. My colleague then did a li'l bit of googling and came up with this thing called "netcat"(nc).

We worked on finding out how it worked. To a certain extent I could figure out how this works

We were working on Unix systems, so nc is generally installed by default
- log in as root on a machine that you want to execute the command in
- run "nc -l -p 32276" . you can add -v for verbose output. see man for more details. This will start an nc process that listens (l) to port (p) 32276
- on the machine from where you want to execute the command run
" nc "ip-address of server" 32276
- this opens a connection pipe over tcp/ip between the two systems and you can communicate between the two systems as you would do with a chat client. do a control-c at any one end and the connection breaks down

Now, if you want to execute a command at the remote end

- log in as root on a machine that you want to execute the command in
- run "nc -l -p 32276" | while read elem; do; $elem;done
- on the machine from where you want to execute the command run
" nc "ip-address of server" 32276
- this opens a connection pipe over tcp/ip between the two systems and you can typ[e in the command that has to be executed at the other end eg: ls, pwd etc... just replace the command with the path to your build script and there you have the build executed remotely.

Disclaimer: I have executed the commands and that seem to work well. Have not tried running build scripts

Wednesday, June 24, 2009

Cool tool to manage remote connections



guys if you are looking for a free tool to manage your connections, remote desktop connections look no further mremote is here.

As you can see I could select the protocol I want and enter user name ..

http://www.mremote.org/wiki/

This tool does not introduce a new protocol or a new way of connecting using the same protocol , but instead relies on putty, terminal services, the gecko framework for rendering web pages, etc which we are already using to connect to remote machines.

All I have to do is create a new connection , select the protocol, enter the user-name and password ... there you go.. u are ready to connect.

All I have to do is right click on the connection and connect.

I have attached a snapshot