Closed pniederlag closed 5 years ago
@pniederlag Thank you for opening issue. I'll take a look on this. Can you please share the following info?
options
for kubectl ssh-jump <dest_node> [options]
22
)cat ~/.kube/kubectlssh/options
sshuser=devops
identity=/home/pn/.ssh/id_MYKEY
pubkey=/home/pn/.ssh/id_MYKEY.pub
portnumber is 22
# from man ssh for '-J':
Note that configuration directives supplied on the command-line generally
apply to the destination host and not any specified jump hosts.
Use ~/.ssh/config to specify configuration for jump hosts.
That's exactly my problem, the -i affects the destination host, but not the jumpHost :-<
Thx for looking into this
@pniederlag Could you please try the following script?
In the script, I changed the way to logon to a target node via ssh-jump like this:
# ssh -i ${identity} -J root@127.0.0.1:2222 ${sshuser}@${destnode}
ssh -i ${identity} -p ${port} ${sshuser}@${destnode} -o "ProxyCommand ssh root@127.0.0.1 -p 2222 -i ${identity} \"nc %h %p\""
I'd like to know if it will work for you. Please try this like this and let me know how it will work.
curl -s https://gist.githubusercontent.com/yokawasa/ead6650601f40a85ee2870cd1e48b7b6/raw/a5a517dbf5aa511a8ae963ddd273868bc95c7329/kubectl-ssh-jump -o kubectl-ssh-jump
chmod +x ./kubectl-ssh-jump
./kubectl-ssh-jump <nodename>
@pniederlag Please kindly let me know if the script will work for you
kubectl-plugin-ssh-jump-0.2.0 has been released. Here is CHANGELOG
I believe the issue can be resolved with the new plugin.
please upgrade the plugin:
kubectl krew upgrade ssh-jump
I can confirm 0.2.0 fixes the problem. Big Thx for your efforts and your great support! :->
Best greets, Peter
first of all, thx for publishing this plugin
I do have troubles on getting the connection to work. While debugging I found that this is the "final" ssh connection string that is used:
ssh extracts an ssh jump-host command from the '-J' option that results in:
In this command the "-i /home/pn/.ssh/id_MYKEY" thingy get's lost. :-<
ssh then seems to attempt a bunch of my ssh keys that are lying around but doesn't pick up the correct (but NON standard named) key.
I could fix this by applying a general ssh-config like so:
While I can get ssh-jump working this way it's not really nice as I don't want to tie 127.0.0.1 to this port/key in general.
Do you have an idea how this could be handled inside ssh-jump?
Thx for your time and feedback, greets, Peter