sshping icon indicating copy to clipboard operation
sshping copied to clipboard

Dockerfile / container image

Open bpmct opened this issue 3 years ago • 2 comments

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.

bpmct avatar Jan 03 '22 01:01 bpmct

FWIW: I just discovered https://github.com/JinnLynn/dockerfiles/blob/master/sshping/Dockerfile. The repo is MIT licensed. Thanks @JinnLynn

bpmct avatar Jan 03 '22 02:01 bpmct

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]

joelpurra avatar Jul 23 '22 12:07 joelpurra