File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -126,30 +126,31 @@ jobs:
126
126
fi
127
127
128
128
129
+
129
130
# Find the first non-comment line (actual key) in hostkey.txt
130
131
KEYLINE=$(grep -v '^#' hostkey.txt | head -n 1)
131
132
if echo "$KEYLINE" | grep -q 'ssh-ed25519'; then
132
- KEYTYPE="ed25519"
133
+ KEYTYPE="ssh- ed25519"
133
134
elif echo "$KEYLINE" | grep -q 'ecdsa'; then
134
- KEYTYPE="ecdsa"
135
+ KEYTYPE="ecdsa-sha2-nistp256 "
135
136
elif echo "$KEYLINE" | grep -q 'ssh-rsa'; then
136
- KEYTYPE="rsa"
137
+ KEYTYPE="ssh- rsa"
137
138
else
138
139
echo "ERROR: Unknown key type in hostkey.txt: $KEYLINE"
139
140
cat hostkey.txt
140
141
exit 1
141
142
fi
142
143
143
- # Extract the fingerprint for the detected key type (from the first matching key line)
144
- FINGERPRINT =$(ssh-keygen -l -f hostkey.txt | grep -i "$KEYTYPE" | head -n 1 | awk '{print $2}')
145
- if [ -z "$FINGERPRINT " ]; then
146
- echo "ERROR: Could not extract fingerprint for $KEYTYPE from hostkey.txt"
144
+ # Extract the full key string for the detected key type
145
+ FULLKEY =$(grep -v '^#' hostkey.txt | grep "$KEYTYPE" | head -n 1 | awk '{print $1 " " $2}')
146
+ if [ -z "$FULLKEY " ]; then
147
+ echo "ERROR: Could not extract full key for $KEYTYPE from hostkey.txt"
147
148
cat hostkey.txt
148
149
exit 1
149
150
fi
150
151
151
- # Add the host key to PuTTY's cache using plink.exe
152
- ./plink.exe -ssh -hostkey "$FINGERPRINT " "$SFTP_HOST" exit || true
152
+ # Add the host key to PuTTY's cache using plink.exe (must use full key string, not fingerprint)
153
+ ./plink.exe -ssh -hostkey "$FULLKEY " "$SFTP_HOST" exit || true
153
154
154
155
# Clean up
155
156
rm -f hostkey.txt
You can’t perform that action at this time.
0 commit comments