Tero Karvinen - Articles - Downloads - Courses - Contact

Table of Contents

Ssh-uploadkeys - Automate SSH Login with Public Key Authentication

Automate login to an ssh account. This is necessary if you are administering multiple workstations.

As far as I know, ssh-uploadkeys is the first key generation and uploading program on posix (linux-like) that asks for password only once.

Usage

$ ssh-uploadkeys karvinen@example.com
Password: [type your password]

After using ssh-uploadkeys, you can connect without a password:

$ ssh karvinen@example.com

How does it work?

If you don’t yet have a keypair, it is created automatically. Then it is uploaded to account ssh://karvinen@example.com and the necessary setup steps are done. You can also create a similar setup manually, but thanks to ssh-uploadkeys, you don’t need to. Actually ssh-uploadkeys is a bit more verbose than above, but one password prompt is really the only user interaction required.

Install

Download the script and make it runnable.

$ wget http://www.iki.fi/karvinen/ssh-uploadkeys/ssh-uploadkeys
$ chmod u+x ssh-uploadkeys
$ ./ssh-uploadkeys karvinen@example.com

Above we used ‘./’ to run it from current location. To make it work without ‘./’:

$ mkdir -p $HOME/bin/
$ mv ssh-uploadkeys bin/

See also

Control many computers with SSH

Ssh public key authentication

Add ssh public key account

Last modified: 2008-02-12. Permanent url: http://www.iki.fi/karvinen/ssh-uploadkeys.html

Tero Karvinen www.iki.fi/karvinen - Top - Validate HTML - Validate CSS