Name

ssh-installkeys — install ssh keys on local and remote servers

Synopsis

ssh-installkeys [-h] [-c] [-p port] [-d] [-v] name@host...

Description

This script tries to export ssh public keys to a specified site. It will walk the user through generating key pairs if it doesn't find any to export. It handles all the fiddly details, like remembering the ssh keyfile names and making sure local and remote permissions are correct. It tells you what it's doing if it has to change anything.

The name@host argument is the name of the host where your public keys should be installed. If it contains a @, the part before the @ will be clipped off and used as the login name. Otherwise your local login name will be used.

Note: this script does not parse your ssh configuration — therefore, if you have specified a different remote user in your configuration, this script will not know that. You can use the user@host syntax to force the remote username.

Invoked with the -h option, the program prints a usage summary and exits.

Invoked with the -c option, the program checks your local and remote ssh configuration for problems without changing anything.

The -p option allows you to set a port number, overriding the default 22. This may be useful if you have a firewall and port forwarding setup.

Invoked with the -d option, the program deletes any public keys under the specified login at the specified host.

The -v option says to report all commands and responses during the session. It's mainly useful for debugging.

Requirements

ssh-installkeys was written in Python 2.2a1. It will not work under Python 1.5.2.

Bugs

There are persistent reports that seem to indicate that this script occasionally chokes on a bogus, empty return from ls -ld, but I don't know what can cause ls -ld to do that and am reluctant to paper over the problem rather than actually fixing it.

If you encounter this or any other bug, the first thing to do is run with -v and see if that clarifies matters. If not, send me a session transcript.

See Also

ssh(1), ssh-keygen(1).

Author

Eric S. Raymond .

There is a project web page at http://www.catb.org/~esr/ssh-installkeys/.