passwordless-ssh is a small Clojure library for bootstrapping passwordless SSH across machines that can already be reached over SSH.
[org.clojars.punit-naik/passwordless-ssh "1.0.0"]
known_hosts.authorized_keys.Each machine is a map like:
{:ip "10.0.0.11"
:ssh-user "ubuntu"
:auth-type "password"
:auth-secret "cluster-pass"}
Optional fields:
:id for stable ordering only:hostname as an extra known_hosts identifier in addition to :ipRequired fields:
:ip:ssh-user:auth-type:auth-secret for supported auth modesSupported :auth-type values:
"password" where :auth-secret is the SSH password"private-key" where :auth-secret is a readable private key path on the machine running this library(ns example
(:require [passwordless-ssh.core :as pssh]))
(def machines
[{:ip "10.0.0.11" :ssh-user "ubuntu" :auth-type "password" :auth-secret "cluster-pass"}
{:ip "10.0.0.12" :ssh-user "ubuntu" :auth-type "password" :auth-secret "cluster-pass"}
{:ip "10.0.0.13" :ssh-user "ubuntu" :auth-type "password" :auth-secret "cluster-pass"}])
(pssh/setup-passwordless-mesh! machines)
;; => {:eligible-machines 3
;; :groups 1
;; :results [{:applied true
;; :skipped false
;; :ssh-user "ubuntu"
;; :auth-type "password"
;; :machine-ips ["10.0.0.11" "10.0.0.12" "10.0.0.13"]}]}
If you want to operate on a single already-compatible group directly:
(pssh/setup-passwordless-group-via-ssh! machines)
:ip of localhost or 127.0.0.1 are excluded from mesh setup.:ssh-user, :auth-type, and normalized :auth-secret.:hostname is optional and only improves known_hosts coverage when hostname-based SSH is used later.StrictHostKeyChecking=no for bootstrap connections.Generated API documentation is available at:
Generated coverage reports are available at:
lein test
Optional Docker integration test:
lein test-cluster-simulation
Keep the Docker integration cluster running after the test for manual inspection:
PASSWORDLESS_SSH_DOCKER_KEEP_CLUSTER=true lein test-cluster-simulation
And then destroy the Docker integration cluster:
docker compose -f test-resources/docker-compose.yml down -v --remove-orphans
License Copyright © 2026 Punit Naik
Distributed under the Eclipse Public License version 2.0.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |