On Linux when using dsa keys I establish passwordless login with the command
ssh-copy-id -i .ssh/id_dsa.pub [email protected]
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?
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:
Then use this key to deploy user key on the target: