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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]