tags:

views:

405

answers:

2

Here is the limitations:

  1. No public key file uploaded to server (since this may be run at different target machine), this is just for an automatic testing program, so security is not a concern.
  2. It's automatically program run background, so no user input.
  3. I do not want to use "expect" which require user to install.
  4. I have know the root user's password.

So I wonder is that a lightweight expect tool or a ssh library I can easily use to do such work.

A: 

The only properly secure way is with an exported SSH public key file, where every client and every server have been verified - otherwise, what's to stop Mr. Havingabadday from exploiting the system?

Chris
security is not a problem we need to care at this situation.
arsane
To a lot of folks, security is never a concern - until something gets broken.
Chris
+1  A: 

libssh http://www.libssh.org/ can help for a C project. Using Perl, there is a module which can be used: Net::SSH (I use it for +/- the same kind of purposes)

Casimir
@casimir, seems works, thanks.
arsane