Thread: SSH via C program

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    SSH via C program

    I need one help on SSH.

    How shall i estalblish SSH connection to other machine and send my char *buffer through c program?

    somewhere i have read that first we have establish connection to other terminal and then run program. In program, i just have to write char *buffer to stdout and my os will take care of putting this data on SSH channel. Any idea about this?

    Yogesh

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    why do want to do it like that rather than using the functions like send and recv.

    ssharish2005

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    send & recv

    send and recv work only with normal TCP/IP socket.

    Here I need information on sending data through SSH.

    In my C program, how shall I ensure that SSH channel is established? Then how to send data through that channel.

    Yogesh

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    20
    You need a SSH library.
    http://www.0xbadc0de.be/libssh:libssh

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    3
    Quote Originally Posted by ssharish2005 View Post
    why do want to do it like that rather than using the functions like send and recv.

    ssharish2005
    Can u explain on the send and recv functions mentioned above?
    To be more specific we have a code dat uses exec service to remote login to a AIX machine.After login it uses send and recv functions.Now it needs to be changed so as to use ssh instead of exec.I am able to connect to the remote machine but there is a prob with send recv part.any help will be appreciated.

  6. #6
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Your opening a thread which is about 3 years old. Please open a new thread.

    ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SSH C Program
    By Joncombat in forum C Programming
    Replies: 1
    Last Post: 11-14-2007, 09:04 AM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. SSH program
    By afreedboy in forum Tech Board
    Replies: 2
    Last Post: 03-18-2005, 10:47 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM