in reply to Populating authorized_keys with Expect

Not sure I understand the specific benefits of using this script - compared to simply scp-ing the public key from the command line - but if a GUI popup for entering the password is preferred... why not.  Looks like a reasonable implementation to me.

As to compromising security, I think it depends on how paranoid you are. The more the password gets passed around, i.e. the more locations in memory it'll ultimately be left behind, the easier it might be for someone to get hold of it... Whether that's an issue, depends on the particular circumstances, e.g. if this is a private machine of yours in a secured environment, and you're the only user, etc.

Replies are listed 'Best First'.
Re^2: Populating authorized_keys with Expect
by Xilman (Hermit) on Nov 25, 2008 at 12:29 UTC

    One specific problem with scp is that it overwrites, not appends.

    I generally scp / sftp the credentials to a temporary file and then append or edit authorized_keys in an interactive session.

    Sometimes I drive it the other way: scp the existing authorized_keys from the remote machine, append the new credential locally and scp it back again.

    Neither of these approaches appear to solve the particular problem posed.