{"id":16354,"date":"2024-10-31T19:30:54","date_gmt":"2024-10-31T19:30:54","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=16354"},"modified":"2024-11-02T06:09:10","modified_gmt":"2024-11-02T06:09:10","password":"","slug":"how-to-set-up-and-use-an-ssh-jumphost","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/","title":{"rendered":"How to Set Up and Use an SSH Jumphost."},"content":{"rendered":"\n<p>An SSH jumphost (or &#8220;bastion host&#8221;) is a secure intermediary server used to access other servers within a private network. Using a jumphost provides an additional layer of security, allowing administrators to restrict direct access to internal servers. Here\u2019s how to set up and use an SSH jumphost.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set Up the Jumphost Server<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Provision the Jumphost<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Set up a server that will act as your jumphost, ideally in a secure network location with access to the internal servers you wish to reach.<\/li>\n\n\n\n<li>Make sure SSH access is enabled.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Harden SSH Security on the Jumphost<\/strong>:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Edit the SSH configuration file on the jumphost:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/ssh\/sshd_config<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure options for added security:\n<ul class=\"wp-block-list\">\n<li>Set <code>PermitRootLogin<\/code> to <code>no<\/code>.<\/li>\n\n\n\n<li>Allow only specific users to access the server by adding <code>AllowUsers yourusername<\/code>.<\/li>\n\n\n\n<li>Disable password-based logins and use SSH keys by setting <code>PasswordAuthentication no<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Restart SSH to apply changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart sshd<\/code><\/pre>\n\n\n\n<p>3. <strong>Set Up SSH Key-Based Authentication<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Generate an SSH key pair on your local machine if you don\u2019t already have one:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t rsa -b 4096<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy the public key to the jumphost:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-copy-id yourusername@jumphost_ip<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure Internal Servers to Accept Connections from the Jumphost<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Allow SSH Access from the Jumphost on Each Internal Server<\/strong>:\n<ul class=\"wp-block-list\">\n<li>On each internal server you want to access via the jumphost, configure the firewall to accept SSH connections from the jumphost&#8217;s IP only.<\/li>\n\n\n\n<li>For example, using UFW:<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow from jumphost_ip to any port 22<\/code><\/pre>\n\n\n\n<p>  2. <strong>Set Up SSH Keys on Internal Servers<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy your SSH public key to each internal server. Run this from your local machine<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-copy-id -o ProxyJump=yourusername@jumphost_ip yourusername@internal_server_ip<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This command uses the <code>ProxyJump<\/code> option to access the internal server via the jumphost.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Access Internal Servers via the Jumphost<\/h3>\n\n\n\n<p>You can connect to the internal servers using SSH through the jumphost in two main ways:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Option 1: Using <code>ProxyJump<\/code> (Recommended)<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect to an internal server by specifying the jumphost with <code>ProxyJump<\/code>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -J yourusername@jumphost_ip yourusername@internal_server_ip<\/code><\/pre>\n\n\n\n<p>   2. Alternatively, to make this easier, add a configuration in your SSH config file on your local machine.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open or create the SSH config file:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>vi ~\/.ssh\/config<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add the following configuration:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Host jumphost\n  HostName jumphost_ip\n  User yourusername\n\nHost internal-server\n  HostName internal_server_ip\n  User yourusername\n  ProxyJump jumphost\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>With this configuration, you can connect to <code>internal-server<\/code> with a simple command:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh internal-server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Option 2: Using <code>ProxyCommand<\/code><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If <code>ProxyJump<\/code> is not supported, you can use <code>ProxyCommand<\/code> to route traffic through the jumphost.<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add this to your SSH config file (<code>~\/.ssh\/config<\/code>):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Host jumphost\n  HostName jumphost_ip\n  User yourusername\n\nHost internal-server\n  HostName internal_server_ip\n  User yourusername\n  ProxyCommand ssh -W %h:%p jumphost<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now, connect to the internal server using:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh internal-server<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Transfer Files through the Jumphost<\/h3>\n\n\n\n<p>You can use <code>scp<\/code> or <code>rsync<\/code> to transfer files via the jumphost.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example Using <code>scp<\/code>:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>scp -o ProxyJump=yourusername@jumphost_ip localfile.txt yourusername@internal_server_ip:\/path\/to\/destination\/<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Example Using <code>rsync<\/code>:<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -e \"ssh -J yourusername@jumphost_ip\" localfile.txt yourusername@internal_server_ip:\/path\/to\/destination\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Additional Security Tips<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Restrict Access to the Jumphost<\/strong>: Limit access to trusted IP addresses only.<\/li>\n\n\n\n<li><strong>Enable Logging and Monitoring<\/strong>: Enable logging on the jumphost to monitor access and potential unauthorized activities.<\/li>\n\n\n\n<li><strong>Use Two-Factor Authentication (2FA)<\/strong>: If possible, enable two-factor authentication for SSH connections on the jumphost.<\/li>\n\n\n\n<li><strong>Regular Updates and Patching<\/strong>: Keep the jumphost updated with security patches and OS updates.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Author&#8217;s Final Word<\/h2>\n\n\n\n<p>Using an SSH jumphost securely allows access to internal servers without exposing them directly to the internet, enhancing your network security.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An SSH jumphost (or &#8220;bastion host&#8221;) is a secure intermediary server used to access other servers within a private network. Using a jumphost provides an additional layer of security, allowing administrators to restrict direct access to internal servers. Here\u2019s how to set up and use an SSH jumphost. Step 1: Set Up the Jumphost Server [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1824,1879,2128],"doc_tag":[],"class_list":["post-16354","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-07","word_count":594,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Up and Use an SSH Jumphost. -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up and Use an SSH Jumphost. -\" \/>\n<meta property=\"og:description\" content=\"An SSH jumphost (or &#8220;bastion host&#8221;) is a secure intermediary server used to access other servers within a private network. Using a jumphost provides an additional layer of security, allowing administrators to restrict direct access to internal servers. Here\u2019s how to set up and use an SSH jumphost. Step 1: Set Up the Jumphost Server [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-02T06:09:10+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-and-use-an-ssh-jumphost\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-and-use-an-ssh-jumphost\\\/\",\"name\":\"How to Set Up and Use an SSH Jumphost. -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"datePublished\":\"2024-10-31T19:30:54+00:00\",\"dateModified\":\"2024-11-02T06:09:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-and-use-an-ssh-jumphost\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-and-use-an-ssh-jumphost\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-set-up-and-use-an-ssh-jumphost\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up and Use an SSH Jumphost.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up and Use an SSH Jumphost. -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Up and Use an SSH Jumphost. -","og_description":"An SSH jumphost (or &#8220;bastion host&#8221;) is a secure intermediary server used to access other servers within a private network. Using a jumphost provides an additional layer of security, allowing administrators to restrict direct access to internal servers. Here\u2019s how to set up and use an SSH jumphost. Step 1: Set Up the Jumphost Server [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/","article_modified_time":"2024-11-02T06:09:10+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/","name":"How to Set Up and Use an SSH Jumphost. -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"datePublished":"2024-10-31T19:30:54+00:00","dateModified":"2024-11-02T06:09:10+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-set-up-and-use-an-ssh-jumphost\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Set Up and Use an SSH Jumphost."}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=16354"}],"version-history":[{"count":2,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16354\/revisions"}],"predecessor-version":[{"id":16552,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16354\/revisions\/16552"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=16354"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=16354"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=16354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}