Results 1 to 7 of 7
What is the easiest way to execute a command on a remote computer?
From my workstation, I want to command my server to dialup the internet via ppp. What is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-25-2005 #1Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
How to execute a command on remote machine?
What is the easiest way to execute a command on a remote computer?
From my workstation, I want to command my server to dialup the internet via ppp. What is the most staightforward, transparent way to do that?/IMHO
//got nothin'
///this use to look better
- 07-26-2005 #2Linux Engineer
- Join Date
- Apr 2005
- Location
- Buenos Aires, Argentina
- Posts
- 908
If the remote machine is running sshd you can easily do it with it.
ssh remotemachine "command"serzsite.com.ar
"All the drugs in this world won\'t save you from yourself"
- 07-26-2005 #3Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
Yeah, I knew that, but thanks for the reply. I'd like for this to be fairly transparent: no more than running a simple command[arg] or clicking an icon like with modemlights. And besides launching it from a Linux remote, I'd like to be able to do it from a Windows 98 machine....but maybe that's another forum.
Originally Posted by serz
The server with the modem will be running sshd as well as nfs and any other service(s) needed to do this.
I can certainly do the research, but I'm not sure which way to start: given that an NFS volume can be referenced with a simple 'server:/dir' statement, it would seem that there may be a bash command that would do it. Or will I need a program and a system call (as if I had a clue!). I know this has been done before over and over, so it should not be that hard to accomplish..../IMHO
//got nothin'
///this use to look better
- 07-26-2005 #4Just Joined!
- Join Date
- Jun 2005
- Location
- Canada, Halifax
- Posts
- 86
Remote commands
Communication between machines should be secure/encrypted thus SSH is definitely the path you should follow; rlogin, telnet and such not secure; do yourself and everyone else in the world a favor and be security conscious: use encrypted connections whenever possible.
By tunneling through an SSH connection you can do almost anything 'transparently'. Check out the following link:
http://www.hackinglinuxexposed.com/a.../20030228.html
If you want to share/span your file system over multiple machines give this a try:
http://www.aerospacesoftware.com/sam...nnel-howto.htm
If these examples doesn't exactly suit your fancy I'm sure it wouldn't be all that difficult to write a socket style presentation-level application that assesses a FIFO on either side of the SSH tunnel to perform whatever task you wish, if you don't want to write one yourself I'm sure someone else has already done so.
For a Windows SSH client use:
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Use putty as your SSH client and and presto, run your transceive application on either side of the SSH connection.
Hope this helps.
Dave.
PS: <edit>
I reread your original post and I suppose none of my examples are 'easy' or one click solutions... not to be glib but anything worth doing is worth doing right!
- 07-26-2005 #5Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
Thanks, davebardsley, for your post. You've given me a few directions to start. I appreciate your point about security, but in the present case, the "remote" machine is on the other side of the room, on the safe side of my firewall. I guess I should have mentioned that.
/IMHO
//got nothin'
///this use to look better
- 07-26-2005 #6Just Joined!
- Join Date
- Jun 2005
- Location
- Canada, Halifax
- Posts
- 86
Remote commands
I didn't mean to sound preachy about the security issue, sorry about that; I just get infuriated by all those spam e-mails that end up in my inbox!

Even though you're developing an application for a computer "on the other side of the room" assume that you or someone out here in cyber-space will find your work useful (assuming you're willing to share it!) and undoubtedly use it to do more than you originally intended; It doesn't take much imagination to visualize a pipe from "cat" and a text/script file to your application running over an SSH tunnel potentially automating or controlling a whole myriad of different tasks.
Cheers!
- 07-26-2005 #7Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Windows has rsh built in too, for running one line command arguments. It is disabled on all of our windows machines at work so I've never been able to play with it though. That's going to windows. But as mentioned Windows to *n?x use putty. It's great...


Reply With Quote
