SSH Proxy, Using a Jumphost
好的,我现在需要帮用户总结一篇文章的内容,控制在100个字以内。用户的要求是直接写描述,不需要特定的开头。 首先,我仔细阅读了文章。作者主要讲述了使用Raspberry Pi和Pi Zero通过Twingate访问远程网络,并遇到的一些问题。为了方便维护,他设置了一个VPN连接到主Raspberry Pi,这样可以在局域网内直接访问。但问题在于Pi Zero也需要连接VPN,这样会增加复杂性。 为了解决这个问题,作者使用了SSH的跳转主机功能。通过在~/.ssh/config文件中配置ProxyJump,可以直接从局域网内的主机连接到Pi Zero,而无需先登录到Raspberry Pi。这样不仅简化了操作,还方便了自动化工具如Ansible的使用。 接下来,我需要将这些要点浓缩到100字以内。重点包括:使用Raspberry Pi和Twingate访问远程网络、VPN设置带来的问题、SSH跳转主机的解决方案及其带来的便利。 最后,确保语言简洁明了,避免技术术语过多,让用户容易理解。 </think> 文章描述了通过Raspberry Pi和Pi Zero使用Twingate访问远程网络的方法,并介绍了如何利用SSH的跳转主机功能直接从局域网访问Pi Zero,解决了维护和自动化中的复杂性问题。 2025-10-14 13:14:17 Author: securityboulevard.com(查看原文) 阅读量:89 收藏

Avatar photo

Those who know me know about my love of the Raspberry Pi. I’ve got tons of them stashed around various places to provide a variety of services. One thing I use them for is to allow me access into remote networks via Twingate for troubleshooting or maintenance purposes. Usually these networks are less sophisticated with consumer-grade tech enabling them, and Twingate provides a nice way to be able to access specific hosts easily over their technology. It does like to have two connectors per network, so in order to keep the portal green, I will put normally a Raspberry Pi and a Pi Zero on that network and have them connect back to Twingate.

In my world, Twingate is used more in the “I need to access this resource at this time” mode, and not “All on, all the time.” I’ve had some issues with leaving Twingate open all the time (be it connected or not) as it sometimes plays with route tables in ways that prevent traffic from flowing. This is especially true in situations of IP conflict.

In order to have an always-on setup for the main Raspberry Pi, I have it VPN back into my network so I can see it just on the LAN like it’s hidden somewhere in my house (this happened once, but rest assured I found the rogue RPi). This way I can do maintenance without firing up Twingate, but it creates a small issue. I don’t want to have BOTH devices VPN back in, just one. This means that if I want to say update the Pi Zero, I need to first jump on the Pi, then ssh from the Pi to the Pi Zero.

Techstrong Gang Youtube

A bit of a hassle, especially when I’m trying to automate things with Ansible.

I wanted a way to be able to touch the Pi Zero “directly” from hosts on my LAN. Thankfully, ssh provides a jump host proxy function natively, and I got it set up in less than a minute! Look below for config if you are in a similar situation, be it for work or pleasure.

To enable this functionality, you need to define both hosts in your ~/.ssh/config file. It will look like this:

# Define the proxy host first.
Host remotepi
    HostName remotepi.example.com
    User username               # replace with your username
    IdentityFile ~/.ssh/id_rsa  # replace with your key

# Now define the Pi Zero attached to that same network.
Host pizero
    HostName 192.168.1.234
    User username
    IdentityFile ~/.ssh/id_rsa
    ProxyJump remotepi

This setup assumes you have ssh access from your LAN (via VPN) to remotepi. You can replace that hostname with a local IP on your network, or in my case, I just use a local DNS server to define the name. As long as you can ssh to remotepi then the next step going to the pizero is available to you. You need the IP on the remote network of pizero, but the magic happens with the “ProxyJump” config line under the pizero definition. This tells SSH to first go to remotepi, then seamlessly launch into pizero.

So there ya go! Seamless proxying of ssh via a jump host

Possibly Related Posts:

*** This is a Security Bloggers Network syndicated blog from Branden R. Williams, Business Security Specialist authored by Branden Williams. Read the original post at: https://www.brandenwilliams.com/blog/2025/10/14/ssh-proxy-using-a-jumphost/?utm_source=rss&utm_medium=rss&utm_campaign=ssh-proxy-using-a-jumphost

Avatar photo

Branden Williams

Dr. Branden R. Williams has more than twenty-five years of experience in business, technology, and cybersecurity as a consultant, strategist, and executive. Dr. Williams has experience working for the largest and smallest institutions as an entrepreneur, practitioner, and advisor. His specialty is navigating complex landscapes—be it compliance, security, technology, or business—and finding innovative solutions that promote growth while reducing risk. He is a practitioner and advisor for the operation, engineering, and management of IT and IS tools. He’s held several executive roles in the industry and served on both the PCICo and EMVCo boards.

branden-williams has 25 posts and counting.See all posts by branden-williams


文章来源: https://securityboulevard.com/2025/10/ssh-proxy-using-a-jumphost/
如有侵权请联系:admin#unsafe.sh