Cocoa App SSH

Discussion in 'Mac Programming' started by spotlite, Jan 28, 2008.

  1. spotlite macrumors newbie

    Jan 28, 2008
    I have just recently decided to learn ObjC and Mac programming. The application I am developing needs to connect through SSH to a box running Fedora in order to run some bins on it, and get the output data, for data processing on the local (Mac) machine. What's the best way to accomplish this? Should I somehow interface Apple's Terminal Application? Is that possible? Or can I make my application SSH to the given server, run commands on it and retrieve data? If so, what libraries or frameworks do I use? Thank you in advance for all your comments.
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Use NSTask to run the built in ssh command line tool.

    Note this is not using the Terminal application: it will work even if Terminal is deleted. But the ssh command is the same as if you typed ssh at the command line.

    You may find the NSTask page at cocoadev useful.
  3. spotlite thread starter macrumors newbie

    Jan 28, 2008
    Thanks much! I tried to write some quick code using NSTask and I kept getting errors, then I read the link your provided me with and everything works perfectly now. Thank you once again.

Share This Page