Skip to content

Commit 5f42855

Browse files
committed
Merge branch 'master' into fix-connection-closed-by-remote-host-issue
2 parents 9199bb8 + 163537d commit 5f42855

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
All notable changes to the "kubectl-plugin-ssh-jump" extension will be documented in this file.
44

5-
## 0.8.0
5+
## 0.7.3
66

7+
- Fix `Connection closed by remote host connection closed by unknown port 65535` issue ([#16](https://github.com/yokawasa/kubectl-plugin-ssh-jump/issues/16))
8+
- Add RSA workaround options (`-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa`)to commands in ProxyCommand only if the local OpenSSH version >= `8.5`
9+
10+
## 0.7.2
11+
12+
- Fix `Bad configuration option: pubkeyacceptedalgorithms` issue ([#18](https://github.com/yokawasa/kubectl-plugin-ssh-jump/issues/18))
13+
- Add OpenSSH version check
14+
- Add RSA workaround options (`-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa`) introduced in [ssh-jump-0.7.1](https://github.com/yokawasa/kubectl-plugin-ssh-jump/releases/tag/0.7.1) only if the local OpenSSH version >= `8.5`
715
- Add verbose option (`-v|--verbose`)
816

917
## 0.7.1
1018

11-
- Fix `root@127.0.0.1: Permission denied (publickey)` issue ([#13](https://github.com/yokawasa/kubectl-plugin-ssh-jump/issues/13)) by adding options like `-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa` which works for newer ssh client scenario
19+
- Fix `root@127.0.0.1: Permission denied (publickey)` issue ([#13](https://github.com/yokawasa/kubectl-plugin-ssh-jump/issues/13))
20+
- Add options like `-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa` which works for newer ssh client (`OpenSSH 8.5+`) scenario
1221

1322
## 0.7.0
1423

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.0
1+
0.7.3

kubectl-ssh-jump

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ get_node_list(){
8282
echo ""
8383
}
8484

85+
get_openssh_verion_number() {
86+
ssh -V 2>&1 | awk -F'[_,]' '{print $2+0}'
87+
}
88+
8589
cleanup_sshjump_pod(){
8690
echo "Clearning up SSH Jump host (Pod)..."
8791
kubectl delete pod sshjump
@@ -198,14 +202,21 @@ run_ssh_node(){
198202
cat ${pubkey_sshjump} | \
199203
kubectl exec -i sshjump -- /bin/bash -c "cat > /root/.ssh/authorized_keys"
200204

205+
# Add default ssh option
206+
sshargs="${sshargs} -o StrictHostKeyChecking=no"
207+
208+
# Add RSA workaround options if the local OpenSSH version >= 8.5
209+
sshversion=$(get_openssh_verion_number)
210+
if [ $(echo "${sshversion} >= 8.5" | bc) -eq 1 ]; then
211+
sshargs="${sshargs} -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
212+
fi
213+
201214
if [ "${destnode}" = "sshjump" ]; then
202-
ssh ${sshuser}@127.0.0.1 -p 2222 -i ${identity_sshjump} \
203-
-o StrictHostKeyChecking=no -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa $sshargs
215+
ssh ${sshuser}@127.0.0.1 -p 2222 -i ${identity_sshjump} ${sshargs}
204216
else
205217
# Using the SSH Server as a jumphost (via port-forward proxy), ssh into the desired Node
206218
ssh -i ${identity} -p ${port} ${sshuser}@${destnode} \
207-
-o "ProxyCommand ssh root@127.0.0.1 -p 2222 -i ${identity_sshjump} -o \"StrictHostKeyChecking=no\" \"nc %h %p\"" \
208-
-o StrictHostKeyChecking=no -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa $sshargs
219+
-o "ProxyCommand ssh root@127.0.0.1 -p 2222 -i ${identity_sshjump} ${sshargs} \"nc %h %p\"" ${sshargs}
209220
fi
210221
# Stop port-forward
211222
kill -3 ${pid_port_forward} 2>/dev/null
@@ -215,7 +226,6 @@ plugin_main() {
215226
skip_agent=no
216227
cleanup_jump=no
217228
cleanup_agent=no
218-
verbose=no
219229
sshargs=""
220230
while [ $# -gt 0 ] ; do
221231
nSkip=1

0 commit comments

Comments
 (0)