DEV Community

Ruan Bekker
Ruan Bekker

Posted on

2

How to use ProxyJump with SSH

Originally posted on blog.ruanbekker.com

I have a dedicated server with LXD installed where I have a bunch of system containers running to host a lot of my playground services, and to access the operating system of those lxc containers, I need to SSH to the LXD host, then exec or ssh into that LXC container.

This became tedious and wanted a way to directly ssh to them, as they don't have public ip addresses, it's not possible but found its possible to access them using proxyjump.

[you] -> [hypervisor] -> [vm on hypervisor]
Enter fullscreen mode Exit fullscreen mode

First step is to create our ssh key:

$ ssh-keygen -t rsa
Enter fullscreen mode Exit fullscreen mode

Add the created public key (~/.ssh/id_rsa.pub) on the hypervisor and the target vm's ~/.ssh/authorized_key files.

Then create the SSH Config on your local workstation (~/.ssh/config):

Host *
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null

Host hypervisor
  Hostname hv.domain.com
  User myuser
  IdentityFile ~/.ssh/id_rsa

Host ctr1
  Hostname 10.37.117.132
  User root
  IdentityFile ~/.ssh/id_rsa
  ProxyJump hypervisor
Enter fullscreen mode Exit fullscreen mode

Now accessing our lxc container ctr1, is possible by doing:

$ ssh ctr1
Warning: Permanently added 'x,x' (ECDSA) to the list of known hosts.
Warning: Permanently added '10.37.117.132' (ECDSA) to the list of known hosts.
root@ctr1~ $
Enter fullscreen mode Exit fullscreen mode

Thank you for reading

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up