{"id":672,"date":"2016-07-06T07:25:58","date_gmt":"2016-07-06T01:55:58","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=672"},"modified":"2026-08-30T20:04:05","modified_gmt":"2026-08-30T14:34:05","slug":"use-jumpbox-to-ssh-to-servers","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/use-jumpbox-to-ssh-to-servers\/","title":{"rendered":"How to Configure SSH ProxyCommand to Access Servers Through a Jumpbox"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a production environment, it is recommended not to expose SSH access to production servers directly to the public internet. A jumpbox can be used as an intermediate server that has access to the production machines, while only the jumpbox is exposed for SSH access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, logging in to the jumpbox first and then connecting to every production server can be inconvenient. Using the SSH <code>ProxyCommand<\/code> option, you can connect directly from your local machine to the production server while automatically routing the SSH connection through the jumpbox.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before proceeding, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access to the jumpbox server.<\/li>\n\n\n\n<li>SSH access to the required production servers.<\/li>\n\n\n\n<li>The hostname or IP address of the jumpbox.<\/li>\n\n\n\n<li>The username required to access the jumpbox and production servers.<\/li>\n\n\n\n<li>SSH installed and configured on your local machine.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n<p><strong>Scenario\/Use case:<\/strong><\/p>\n<p>Consider that we have a jumpbox that has access to all the production machines, and we don&#8217;t want to expose SSH access to the public. In such a scenario, we can allow only the jumpbox to be publicly accessible, and through the jumpbox, we can access the remaining machines. But it&#8217;s a pain to log in to the jumpbox and do ssh to the production hosts.<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p>Here comes the easy solution that we can apply from your local machine so we can directly SSH from your local machine.<\/p>\n<p><em>Assumption:<\/em><\/p>\n<ol>\n<li>You should have access to the jumpbox as well production host. Otherwise, you will have to enter the password.<\/li>\n<li>Hostname or IP address of the jumpbox (In our case, we are using jumpbox.domain.tld)<\/li>\n<\/ol>\n<p>On your local machine, open the terminal and open\u00a0<em>.ssh\/config.\u00a0<\/em> This file may\/may not exist. We can create the file and append the following content.<\/p>\n<p><code><\/code><code>Host\u00a0*<br \/>\nProxyCommand\u00a0 ssh username@jumpbox.domain.tld nc %h %p 2&gt; \/dev\/null<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>In the above case, when the user(username) tries to log in from their local machine, it will route the traffic through the jumpbox.<\/p>\n<p><strong>Advanced Use Case:<\/strong><\/p>\n<p>Let&#8217;s consider if we have the hostname all end with <em>domain.tld<\/em> and we can set up a jumpbox only particular to <em>domain.tld.<\/em><\/p>\n<p><code>Host\u00a0*.domain.tld<\/code><\/p>\n<p><code>ProxyCommand \u00a0ssh username@jb.domain.tld\u00a0nc %h %p 2&gt; \/dev\/null<\/code><\/p>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By configuring SSH <code>ProxyCommand<\/code>, you can connect directly to production servers from your local machine through the jumpbox. This eliminates the need to manually log in to the jumpbox before accessing production hosts and provides a convenient way to manage servers while keeping direct SSH access to production machines restricted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In a production environment, it is recommended not to expose SSH access to production servers directly to the public [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-web-architecture","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-aQ","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"predecessor-version":[{"id":11185,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions\/11185"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}