sshping
sshping copied to clipboard
Dockerfile / container image
A sshping container could be used to benchmark SSH connections without installing libssh-dev and building sshping on a local machine.
For example:
docker run -v $HOME/.ssh/:/root/.ssh` sshping -d myserver.com
I'm not sure fi this is possible, and may not work with all hosts/networks however.
FWIW: I just discovered https://github.com/JinnLynn/dockerfiles/blob/master/sshping/Dockerfile. The repo is MIT licensed. Thanks @JinnLynn
The jinnlynn/sshping image works well.
Usage note: am (only) mapping the SSH_AUTH_SOCK environment variable, allowing smartcard authentication through the local ssh-agent's socket file. Without a volume for ~/.ssh/config the container doesn't know about per-hostname usernames/aliases though, but that's alright with me.
Below is an SSH_AUTH_SOCK example for sshping against [email protected].
docker run \
--rm \
--init \
--name sshping \
-v "${SSH_AUTH_SOCK}:/tmp/ssh.sock:ro" \
--env SSH_AUTH_SOCK='/tmp/ssh.sock' \
jinnlynn/sshping \
--verbose --human-readable [email protected]