Skip to content

Instantly share code, notes, and snippets.

@carlos-algms
Last active March 13, 2024 14:42
Show Gist options
  • Save carlos-algms/f8bfb1052e862f0d10fed2daa4b75295 to your computer and use it in GitHub Desktop.
Save carlos-algms/f8bfb1052e862f0d10fed2daa4b75295 to your computer and use it in GitHub Desktop.
Benchmark SSH ciphers transfer speed - Mac and Linux
#!/usr/bin/env bash
# Creates a 100Mb file send via SSH and test the transfer speed
perl -e 'print "\0" x 100000000' > test.txt && du -sh test.txt
# get a list of available ciphers on your machine
CIPHERS="$(ssh -Q cipher)"
for cipher in $CIPHERS; do
echo "$cipher"
# Try every cipher 2 times
for try in 1 2; do
scp -c "$cipher" test.txt user@yourhost.com:/dev/null
done
echo " ------ "
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment