-1

On Linux when using dsa keys I establish passwordless login with the command

ssh-copy-id -i .ssh/id_dsa.pub user@target.host

This prompts the user for user's password on target.host. My script knows the password and the user shall not be bothered, how can I do this?

1 Answers1

-1

Just generate a pair of keys and provide it with your script. This would be the preshared key to upload a real key.

EDIT: Generate a separate keys for keydeployment: (deploy, deploy.pub), ship them with your script. This mean that from machine with script (so with those keys) you just can login without a password:

ssh -i ./deploy.pub user@target.host

Then use this key to deploy user key on the target:

cat deploy.pub .ssh/id_dsa.pub > both.pub
ssh-copy-id -i ./both.pub user@target.host
neutrinus
  • 1,155