spook / sshping

ssh-based ping: measure character echo latency and bandwidth
Other
297 stars 46 forks source link

Dockerfile / container image #30

Open bpmct opened 2 years ago

bpmct commented 2 years ago

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 commented 2 years ago

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

joelpurra commented 2 years ago

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 user@server.example.

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 user@server.example