unix - Simulate key presses in C -


for example, want run:

ssh root@127.0.0.1 -p 2222 

in c (via system) command. right after run that, asks input:

root@127.0.0.1's password: 

then i'm expected type in password. how can in c code? please code on how simulate key presses? or there better way this?

there beautiful command expect

this common used tool. if need ssh, you'd better @ other posts generating key


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -