Auto copy ssh key on successful ssh password login

ssh

Is it possible to auto copy my ssh key after a successful first time ssh login with password ?

In other words :

when I type :

ssh user@host

for the first time to that host and I successfully enter the right password I get my ssh key automatically copied to that host without the need to do : copy-ssh-key command manually

Best Answer

If you want to add your public key to authorized_keys on a remote machine, an answer may be ssh-copy-id (e.g. part of openssh-clients).

Related Question