Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Fancy SSH

28 Feb 2020 » ssh, config

The server I needed to get to was only accessible via the host. So I had to ssh to the host and then from the host to the server I needed to get into. The ssh process was a little annoying so I found a better way to jumpbox.

Setup

On my current laptop I have an ssh config for ssh’ing into my server at home. The ssh config looks like (don’t mind the X11 stuff. I use it for graphical applications when I have to.):

host xps
    HostName 192.168.1.136
    port 22
    User jack
    IdentityFile /Users/Jack/.ssh/id_rsa
    ForwardAgent yes
    ForwardX11 yes
    ForwardX11Trusted yes

And then on my XPS server I have a configuration file to ssh to guest OS’s which looks like the following:

Host pbox
  Hostname 10.0.0.141
  IdentityFile /home/jack/.ssh/id_rsa
  user jack

I wanted to skip the extra command at the XPS prompt to ssh into the projectbox. I’m all about efficiency. I tried multiple different ssh commands including passing the -J flag, using -o ProxyCommand="" and none of it seemed to work.

After googling around a bit I found some guys blog post and he reccommended chaining the command.

ssh -A -t xps ssh -A pbox

Sure enough its exactly what I wanted. This is how it works: 1) Connect to the jump-host: ssh -A -t xps 2) Execute Command ssh -A pbox

The -t flag forces the xps host to allocate a psuedo tty.

© Jack Moore - This site was last built Fri 30 Aug 2024 12:31:24 PM EDT