-
Notifications
You must be signed in to change notification settings - Fork 6
/
sshmd5
executable file
·27 lines (23 loc) · 1003 Bytes
/
sshmd5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# generate an md5 signature of a ssh server
#####################################################################################
# generating a fingerprint client-side is inherently risky!
# where possible the server operator should provide this to you!
#####################################################################################
# logic apps & power platform only support MD5 fingerprints for host verification
# yes, the rest of the world stopped using md5 fingerprints quite some time ago
# https://docs.microsoft.com/en-us/azure/connectors/connectors-sftp-ssh#prerequisites
#####################################################################################
# source: https://gist.github.com/parsa/b37dd02033718729304ff33af261a67f
if [ -z "$1" ] || [ -z "$2" ]; then
echo "usage: sshmd5 sftp.uber.com 2222"
exit 1
fi
ssh-keyscan -p $2 -t rsa \
$1 2>/dev/null \
| awk '{ print $3 }' \
| base64 -d \
| md5sum \
| awk '{ print $1 }' \
| fold -w2 \
| paste -sd':' -