Skip to content
Phil Hagelberg edited this page Dec 28, 2012 · 9 revisions

Clojars uses SSH as one way of pushing jars. Before you can upload your jars you’ll to need to paste an SSH public key into your profile.

Creating a key

First check whether you already have one, usually it will be located in ~/.ssh/ and named id_rsa.pub, id_dsa.pub or identity.pub. It’s perfectly safe to give the same public key to multiple websites or servers (that’s why it’s called public).

Unix-like systems

On most unix systems, SSH is already installed and you can use the ssh-keygen tool to create one. Simply type

ssh-keygen -t rsa

You can optionally put a passphrase on the key that must be typed when using it. If you’re the only one with access to your computer, for Clojars it’s probably reasonable to use a blank passphrase.

Windows

Windows unfortunately doesn’t come with SSH, but you can use the excellent PuTTY implementation. You’ll need puttygen.exe to generate keys and pscp.exe for pushing jars. Note that Clojars expects the public key to be exported in OpenSSH format.

You may find lein-clojars or HTTPS pushing more convenient options on Windows.

Leiningen

The lein-clojars plugin for Leiningen includes a simple key-generator you can use if you don’t have ssh-keygen or putygen.exe installed. Once you’ve added lein-clojars to your project’s dev-dependencies simply type:

lein keygen

The generated key will be placed in ~/.leiningen/id_rsa.pub.

Clone this wiki locally