Thread: remote control

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    630

    remote control

    Hello

    I've been wondering what would be the best way to manipulate with my application - server
    (send commands, etc.).
    I've come accross SSH but this would take too much work to implement it and
    I dont want to use openSSH - 3rd part source code which is compilable only
    with cygwin. I want to keep clean code.

    Telnet would be one option but this is not secure, again HTTP (web)
    interface would be one option, but I'd prefer console-like shell and also it
    should be portable and doesnt have to be user-friendly (like web interface).

    Do you guys have any ideas for alternatives? What do you prefer?

    Best

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Why not write a small, simple control module? Like an HTTP interface, or just a simple command line app that connected to the server and did it's work. (Telnet wouldn't be bad, then you wouldn't have to write the client.)

    However, in the server's code for whatever method you choose, have it bind the listening socket to the loopback interface only, so that only that computer could access it. Then if you need to get into it from afar, using a normal SSH setup, just SSH in, access telnet/your control app/whatever, and do your work? Like:
    Code:
    Remote client
         |
      (SSH connection)
         |
    Server computer, SSH session
         |
      (telnet, HTTP, custom protocol, etc)
         |
    Server computer, control server, only accessible on localhost:XXXX
    Configured correctly, it should be secure (as long as your SSH setup is), and leaves you to focus on how to control your server.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    630
    What would be the best choice in your opinion?
    Are there SSL telnet implementations or something similar?
    Maybe SSH for c++ that doesnt need cygwin?

  4. #4
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Did you understand my reply?

    I'd forgotten that SSH could tunnel connections, which, seems perfect here. Write a simple client/server interface, and then just tunnel through SSH. Keep it bound to localhost, and you won't forget.

    Example: I sometimes VNC into my Linux box. (VNC = remote desktop application) However, VNC, AFAIK, does not encrypt keystrokes - very unappealing, especially if I have to send my root password. Enter SSH. I ssh into the box, and ask SSH to tunnel a VNC connection. Then I have the VNC connect to some port on localhost, which the SSH client is listening on, and it then forwards the VNC communications, encrypted, to the server. ie:
    1 connection from server box to remote box - SSH, encrypted.
    1 connection over loopback interface on the server box - SSH server to your server
    1 connection over loopback interface on the remote box - SSH client to your custom client

    EDIT: Bah, I thought this sounded familiar. Same input, same output, lol. This is just the way I'd go about it. Anything more specific I can offer you?
    Last edited by Cactus_Hugger; 07-12-2008 at 03:34 PM.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    630
    Quote Originally Posted by Cactus_Hugger View Post
    Did you understand my reply?

    I'd forgotten that SSH could tunnel connections, which, seems perfect here. Write a simple client/server interface, and then just tunnel through SSH. Keep it bound to localhost, and you won't forget.

    Example: I sometimes VNC into my Linux box. (VNC = remote desktop application) However, VNC, AFAIK, does not encrypt keystrokes - very unappealing, especially if I have to send my root password. Enter SSH. I ssh into the box, and ask SSH to tunnel a VNC connection. Then I have the VNC connect to some port on localhost, which the SSH client is listening on, and it then forwards the VNC communications, encrypted, to the server. ie:
    1 connection from server box to remote box - SSH, encrypted.
    1 connection over loopback interface on the server box - SSH server to your server
    1 connection over loopback interface on the remote box - SSH client to your custom client

    EDIT: Bah, I thought this sounded familiar. Same input, same output, lol. This is just the way I'd go about it. Anything more specific I can offer you?
    So I just make while getstring loop to give the commands to the application?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Howto make own application for remote control handling
    By s-men in forum Windows Programming
    Replies: 16
    Last Post: 08-16-2008, 04:22 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Remote Control
    By nvoigt in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 05-19-2003, 07:31 AM
  4. Remote PC Control
    By LuckY in forum Windows Programming
    Replies: 3
    Last Post: 03-26-2003, 10:19 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM