SSH in fact already has support for one time passwords: skey. See http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/...
SSH in fact already has support for one time passwords: skey. See http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/...
The risk to the private key is that somebody gets access to your system without your knowledge, but since you need a way to auth to the remote system for this script to put the one-time keys there... what stops the attacker from grabbing the not-one-time key or other creds?
If I really wanted some kind of rotating key-based-auth, I'd probably do it via some mechanism where the server pulled valid keys. Offhand, using sshd_config's AuthenticationMethod combined with some GPG signed pubkey lists hosted somewhere, such that it could pull a list of one-time pubkeys and then nix them as they were used.
Upside there: as others have pointed out in this thread, a big issue for this is that a non-root user typically can write to their own .ssh/authorized_keys, negating the "one-time" nature of this access. Moving the pubkey-checking outside of their control would limit that, local priv-esc vulns aside.