Skip to content

Instantly share code, notes, and snippets.

@creshal

creshal/ssh-benchmark

Last active Aug 29, 2015
Embed
What would you like to do?
ssh-benchmark
#! /bin/bash
pgrep sshd >/dev/null || (echo "Please make sure SSH is running _locally_." && exit 1)
sz=${1:-128}
testfile=$(mktemp -p /run/user/$UID)
filename=$(basename $testfile)
echo "Generating temporary file, $sz MiB size. Supply a size argument to change. (Should be small enough to fit in RAM twice.)"
dd if=/dev/urandom of=$testfile bs=1048576 count=$sz
for cipher in 3des-cbc aes128-cbc aes128-ctr aes128-gcm@openssh.com arcfour arcfour128 blowfish-cbc cast128-cbc chacha20-poly1305@openssh.com; do
echo ""
echo "Cipher $cipher, without compression:"
scp -c $cipher $testfile localhost:/run/user/$UID/out-$filename
rm /run/user/$UID/out-$filename &>/dev/null
done
echo "Final test, compressed aes128-ctr:"
scp -C -c aes128-ctr $testfile localhost:/run/user/$UID/out-$filename
rm $testfile &>/dev/null
rm /run/user/$UID/out-$filename &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment