Last active
March 13, 2024 14:42
-
-
Save carlos-algms/f8bfb1052e862f0d10fed2daa4b75295 to your computer and use it in GitHub Desktop.
Benchmark SSH ciphers transfer speed - Mac and Linux
This file contains hidden or 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
#!/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 [email protected]:/dev/null | |
done | |
echo " ------ " | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment