• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SSH Wrapper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSH Wrapper


  • Subject: Re: SSH Wrapper
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 25 Jun 2008 14:28:17 -0700


On 25 Jun '08, at 2:01 PM, Kevin Ferguson wrote:

I am, however, running into a problem. I have my task set up to go. The issue I'm running into is that SSH obviously requires a password authentication. Reading though the SSH man page, I can't find a flag that lets you specify a password in the initial command.

Right, because putting passwords on the command line is a security hole — the command line is visible to other users and processes on that machine using the "ps" command or equivalent API.


There doesn't appear to be any way to make my application wait for the password prompt, either.

If you connect an NSOutputStream to the NSTask's stdin, you can write to that stream and it'll be read by the task. You don't have to wait; the task won't read the input until it's ready for it.


However, trying to wrap around the 'ssh' tool is kind of complex and error-prone. For example, there are other prompts that the tool might make, and in some modes it doesn't read a password at all (like if the user already has a cert installed on the target machine.)

You might consider using the libssh2 library instead <http://www.libssh2.org/wiki/index.php/Main_Page >.

—Jens


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: SSH Wrapper
      • From: "Stephen J. Butler" <email@hidden>
References: 
 >SSH Wrapper (From: Kevin Ferguson <email@hidden>)

  • Prev by Date: Re: Adding a new type of NSButton
  • Next by Date: sphere in openGL ES ++IRC
  • Previous by thread: SSH Wrapper
  • Next by thread: Re: SSH Wrapper
  • Index(es):
    • Date
    • Thread