N Fard
N Fard

Reputation: 1099

Run command in Terminal from Application

I have an app that needs to run a command in the terminal. or i want to run this command in my app.

ssh -N -p 24 -g -D 1080 username@server

plz help me . tnx

Upvotes: 0

Views: 1017

Answers (3)

rpetrich
rpetrich

Reputation: 32346

You've marked this question as iphone and iphone-sdk, but it's not possible to fork or exec in an App Store application. If you need SSH connectivity for your application, you can use a library like libssh2, but you won't be able to reuse the standard ssh command.

Upvotes: 4

saramah
saramah

Reputation: 168

Try ssh keys. Check out ssh-keygen for more information. Simply generate a key for yourself, put the public key (usually ~/.ssh/id_rsa.pub) in a file called ~/.ssh/authorized_keys on the box you want to ssh into, and voila, it should just work :)

Upvotes: 3

hhafez
hhafez

Reputation: 39800

Your comment is the solution to your question ;)

Upvotes: 1

Related Questions