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
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.
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 :)
Your comment is the solution to your question ;)
精彩评论