SSH into remote host using jump box

sshssh-keysssh-tunnel

I have a current setup for my servers like below:

My computer ---> Jump box -----> Target server in private network

I connect to the jump box from my computer using command

ssh -A jumpbox

and from jump box to target server using

ssh target server

Now I want to directly connect to the target from my computer, I have tried ProxyCommand and I don't want to do netcat to connect to the target server. Then I came across ProxyJump and tried the following config

Host <some name to target>
    Hostname <IP of Target>
    User <My user name>
    ForwardAgent yes
    Port 22
    ProxyJump <IP of Jumpbox>

I am getting public key denied error, Can someone tell me where I am going wrong?

Best Answer

The following will work:

ssh target.server -J jumpbox.server

Related Topic