Last active
August 29, 2015 14:24
-
-
Save creshal/9b3258aefa7946378bdb to your computer and use it in GitHub Desktop.
ssh-benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 [email protected] arcfour arcfour128 blowfish-cbc cast128-cbc [email protected]; 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