<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SSH</id>
	<title>SSH - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SSH"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSH&amp;action=history"/>
	<updated>2026-05-15T09:16:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=353&amp;oldid=prev</id>
		<title>Ardika Sulistija at 19:15, 4 August 2025</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=353&amp;oldid=prev"/>
		<updated>2025-08-04T19:15:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:15, 4 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l353&quot;&gt;Line 353:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 353:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Another good link: https://www.ssh.com/ssh/agent&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Another good link: https://www.ssh.com/ssh/agent&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;====Enable SSH Tunneling for Jump Servers====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To use an Ubuntu server as a jump server for SSH access to other hosts in a private network, you need to configure SSH to allow port forwarding. This setup enables users to SSH into the jump server and then use SSH to connect to other hosts within the private network.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Here’s a step-by-step guide to set this up:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1. Configure SSH to Allow TCP Forwarding&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You need to edit the SSH configuration file to allow TCP forwarding. This is done by setting AllowTcpForwarding to yes. Open the SSH configuration file:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; sudo vim /etc/ssh/sshd_config&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Find the line that says AllowTcpForwarding and ensure it is set to yes. If the line is commented out (with a # at the beginning) or not present, you can add it or uncomment it:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; AllowTcpForwarding yes&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2. Restart the SSH Service&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;After making changes to the SSH configuration, restart the SSH service to apply the changes:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; sudo systemctl restart sshd&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;3. Using SSH with Port Forwarding&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Users can now SSH into the jump server and use local port forwarding to access hosts in the private network.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Example: Local Port Forwarding&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Suppose you want to access a private host at 192.168.1.100 on port 22 through the jump server. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You can set up local port forwarding like this:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ssh -L 2222:192.168.1.100:22 user@jump_server&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This command forwards connections from your local machine’s port 2222 to port 22 on 192.168.1.100 via the jump server.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;After running this command, you can SSH into the private host by connecting to localhost on port 2222:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ssh -p 2222 dst_user@localhost&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;What Does &amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b&amp;gt; Do?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b is an SSH configuration directive that controls whether TCP port forwarding is permitted. When set to yes, it allows users to forward TCP ports, which is essential for scenarios like the one described above where you need to access private network hosts through a jump server.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Additional Security Considerations&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Restrict Access: Ensure that only authorized users can SSH into the jump server. This can be done using AllowUsers or AllowGroups directives in the SSH configuration file.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Firewall Rules: Configure firewall rules to allow SSH access to the jump server and restrict access to the private network as needed.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Key-Based Authentication: Encourage or enforce the use of key-based authentication for SSH to enhance security.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;By following these steps, you can effectively use an Ubuntu server as a jump server to access hosts within a private network via SSH.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=169&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot;  &lt;b&gt;ssh&lt;/b&gt; — SSH stands for &lt;b&gt;Secure Shell&lt;/b&gt;. OpenSSH SSH client (remote login program).  The &lt;b&gt;SSH&lt;/b&gt; protocol &lt;b&gt;uses encryption to secure the connection between a client and a server&lt;/b&gt;. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network.    Uses for SSH protocol: * Providing secure access for users and automated processes. * Interactive and automated file transfers * Issuing remote commands...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=169&amp;oldid=prev"/>
		<updated>2024-09-11T14:26:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  &amp;lt;b&amp;gt;ssh&amp;lt;/b&amp;gt; — SSH stands for &amp;lt;b&amp;gt;Secure Shell&amp;lt;/b&amp;gt;. OpenSSH SSH client (remote login program).  The &amp;lt;b&amp;gt;SSH&amp;lt;/b&amp;gt; protocol &amp;lt;b&amp;gt;uses encryption to secure the connection between a client and a server&amp;lt;/b&amp;gt;. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network.    Uses for SSH protocol: * Providing secure access for users and automated processes. * Interactive and automated file transfers * Issuing remote commands...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ssh&amp;lt;/b&amp;gt; — SSH stands for &amp;lt;b&amp;gt;Secure Shell&amp;lt;/b&amp;gt;. OpenSSH SSH client (remote login program).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;SSH&amp;lt;/b&amp;gt; protocol &amp;lt;b&amp;gt;uses encryption to secure the connection between a client and a server&amp;lt;/b&amp;gt;. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Uses for SSH protocol:&lt;br /&gt;
* Providing secure access for users and automated processes.&lt;br /&gt;
* Interactive and automated file transfers&lt;br /&gt;
* Issuing remote commands&lt;br /&gt;
* Managing network infrastructure and other mission-critical system components. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How Does the SSH Protocol Work====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The protocol works in the &amp;lt;u&amp;gt;client-server model&amp;lt;/u&amp;gt;, which means that the connection is established by the SSH client connecting to the SSH Server.&lt;br /&gt;
 &lt;br /&gt;
After the setup phase the SSH protocol uses strong encryption and hashing algorithms to ensure the privacy and integrity of the data that is exchanged between the client and server.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;b&amp;gt;SSH Client&amp;lt;/b&amp;gt; initiates the connection by contacting the &amp;lt;b&amp;gt;SSH Server&amp;lt;/b&amp;gt; &lt;br /&gt;
# &amp;lt;b&amp;gt;SSH Server&amp;lt;/b&amp;gt; sends the server public key to the &amp;lt;b&amp;gt;SSH Client&amp;lt;/b&amp;gt;&lt;br /&gt;
# Negotiate parameters and open secure channel&lt;br /&gt;
# User login to server host operating system&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SSH diagram.png|class=img-responsive]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====How Does Authentication Work?=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initializing a connection in SSH consists of:&lt;br /&gt;
* Negotiating the version of protocol to use.&lt;br /&gt;
* Negotiating cryptoigraphic algorithms and other options to use&lt;br /&gt;
* Negotiating a one-time session key for encrypting the rest of the session&lt;br /&gt;
* Authenticating the server host using its host key&lt;br /&gt;
* Authenticating the user using a password, public key authentication, or other means.&lt;br /&gt;
&lt;br /&gt;
After this, data can be exchanged, including terminal data, graphics, and files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Public Key Authentication&amp;lt;/b&amp;gt; - The key-based authentication mechanism in SSH is called public key authentication. &lt;br /&gt;
* Essentially, some session-specific data is signed using the private identity key. The signature is then sent to the server that checks if the key used for signing is configured as an authorized key. The server then verifies the digital signature using the public key in the authorized key. The identity key is never sent to the server.&lt;br /&gt;
* The essential thing in public key authentication is that it allows one server to access another server without having to type in a password. &lt;br /&gt;
* This powerful feature is why it is so widely used for file transfers (using the SFTP protocol) and configuration management. It is also commonly used by system administrators for single sign-on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSH Key Pairs====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strong authentication with SSH keys&lt;br /&gt;
* The idea is to have a cryptographic key pair (&amp;lt;b&amp;gt;Public&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;private&amp;lt;/b&amp;gt; keys), and configure the public key on the server to authorize access and grant anyone who has a copy of the private key to access the server.&lt;br /&gt;
* &amp;lt;b&amp;gt;Private Keys&amp;lt;/b&amp;gt; (identify keys) are typically stored in a user&amp;#039;s &amp;lt;b&amp;gt;~/.ssh&amp;lt;/b&amp;gt; directory on the &amp;lt;b&amp;gt;client machine&amp;lt;/b&amp;gt;.&lt;br /&gt;
* The &amp;lt;b&amp;gt;public key &amp;quot;fingerprint&amp;quot;&amp;lt;/b&amp;gt; is in the &amp;lt;b&amp;gt;~/.ssh/authorized_keys&amp;lt;/b&amp;gt; file on the &amp;lt;b&amp;gt;server&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Different Type of SSH Keys=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;RSA&amp;lt;/b&amp;gt; is well-regarded and supported everywhere. It is considered quite secure. Common key sizes go up to 4096 bits and as low as 1024. The key size is adjustable. &amp;lt;u&amp;gt;You should choose RSA&amp;lt;/u&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;DSA&amp;lt;/b&amp;gt; is not in common use anymore, as &amp;lt;u&amp;gt;poor randomness&amp;lt;/u&amp;gt; when generating a signature can leak the private key. In the past, it was guaranteed to work everywhere as per RFC 4251, but this is no longer the case. DSA has been standardized as being only 1024 bits (in FIPS 186-2, though FIPS 186-3 has increased that limit). &amp;lt;b&amp;gt;OpenSSH 7.0 and newer actually disable this algorithm. (WEAK)&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;ECDSA&amp;lt;/b&amp;gt; is newer and is based on DSA. It has the &amp;lt;u&amp;gt;same weaknesses as DSA&amp;lt;/u&amp;gt;, but it is generally thought to be more secure, even at smaller key sizes. It uses the NIST curves (P256).&lt;br /&gt;
* &amp;lt;b&amp;gt;Ed25519&amp;lt;/b&amp;gt;, while not one you listed, is available on newer OpenSSH installations. It is similar to ECDSA but uses a &amp;lt;u&amp;gt;superior curve&amp;lt;/u&amp;gt;, and it does not have the same weaknesses when weak RNGs are used as DSA/ECDSA. It is generally considered to be the strongest mathematically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====What Do SSH Keys Look Like=====&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Private Key (identity key) will look something like this; Will have ---BEGIN, ---END:&lt;br /&gt;
 -----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
 MIIEpAIBAAKCAQEA0oDN+mOxkL6qJuBOP2LgcocJeqC2NWZ/kr6pTMitIyI0iejr&lt;br /&gt;
 bUw9N7rTSgLUrwJPK/rexiUUkZZkOl6Q8VQYE5jj+vyFeRUPSjM67hC8FT5CuTsy&lt;br /&gt;
 VFIVD29Vi+M4xEX98DhkUWGoBT2MIJVH1v4NRP+FNtXnUSlnryvdNKVtxBFpK/2S&lt;br /&gt;
 TeC4g4MX5/GVwEUW7/mIWdEv/6f13grcPLs2wTbKrAS/tsyK0KiDjsjuTNV757C8&lt;br /&gt;
 1sHM5MX7JtLLR8tdzqLrHdBVNgH2PmR76PEkYb7bZNeRhEGs8aRQ4cpPH+BQ0h5V&lt;br /&gt;
 hkaZPsgaqbu5OBgDkdFULa3WrjWJcScLIf9WC5dZRntDvn2L/pPC24GKaKunU1GY&lt;br /&gt;
 loL6Ii+z318Qi2N+RImsjBkCgYBcd+Jcl0lFSkKyWqdVB+2s6PDG0OKfxZwBSSpi&lt;br /&gt;
 U78cRrEg7SqwxT8tj2wtUhc0e+EB61zzqaRT2rTWYOpEgS2nf+/gpWCuFxu47ClU&lt;br /&gt;
 cAC2p32U8x40AeMsAuWv+iYzX+7Kd6zc0ttUVfalLNEZ1oETLmyOxveTGKLgKbgA&lt;br /&gt;
 TwKlrQKBgQCj6SdAlGQHndlCutadpY5jQT9bUhg1dDsjckJ30EaaS+7cZXn2hcPJ&lt;br /&gt;
 4UNXn0OmelqKym6K96f0+3EhXFUNEUzo/Tky3nZ9c+qA1goTAuoS/GYTQZJJJ0VG&lt;br /&gt;
 A7w+S7LFGEoSflcI/Ph80cYKJJBzIUfr3BavDGlArnncvasNr0It4w==&lt;br /&gt;
 -----END RSA PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Public key fingerprint or authorized key will look like this:&lt;br /&gt;
 ssh-rsa&lt;br /&gt;
 AAAAB3NzaC1yc2EAAAADAQABAAABAQDSgM36Y7GQvqom4E4/YuByhwl6oLY1Zn+SvqlMyK0jIjSJ6OttTD03utNKAtSvAk8r+t7GJRSRlmQ&lt;br /&gt;
 6XpDxVBgTmOP6/IV5FQ9KMzruELwVPkK5OzJUUhUPb1WL4zjERf3wOGRRYagFPYwglUfW/g1E/4U21edRKWevK900pW3EEWkr/ZJN4LiDgx &lt;br /&gt;
 fn8ZXARRbv+YhZ0S//p/XeCtw8uzbBNsqsBL+2zIrQqIOOyO5M1XvnsLzDVGnZPhJmF7/7BwRR2bJATfK/j5VVe3ZK8RkuDoh7TzMn2hvqm&lt;br /&gt;
 WcxDn1H+x2hAUOp4+zh+XF/NNeljKTnj8CUVvcGu8bhK2OrUm/F ec2-user@ip-172-31-33-239.ec2.internal&lt;br /&gt;
&lt;br /&gt;
(Note, I had to break these lines up for the sake of showing how it looks on this wiki. &amp;lt;b&amp;gt;Really the whole things is one long string&amp;lt;/b&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Permissions=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The proper permissions and other notes&lt;br /&gt;
 drwx------ 1 ardika ardika 4096 Jan 13 14:26 .ssh/                       # 700&lt;br /&gt;
 -rw------- 1 ardika ardika 1671 Jan  6 21:59 .ssh/private_key.pem        # 600&lt;br /&gt;
 -rw-r--r-- 1 ardika ardika 404 Jun 13  2019 .ssh/public_key.pub          # 644&lt;br /&gt;
 -rw------- 1 ec2-user ec2-user 391 Jan 11 22:58 .ssh/authorized_keys     # 600&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSH Configuration File====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;/etc/ssh/sshd_config&amp;lt;/b&amp;gt; - The SSH configuration file. &lt;br /&gt;
&lt;br /&gt;
Configurations you can adjust:&amp;lt;/br&amp;gt;&lt;br /&gt;
- Listening port number&amp;lt;/br&amp;gt;&lt;br /&gt;
- RSAAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- RSAAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PubkeyAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PasswordAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PermitRootLogin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are some &amp;quot;how-to&amp;#039;s&amp;quot; when modifying the sshd_config file to enable/disable certain features of the SSH service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====File Transfers over SSH====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;[[SCP|SCP]]&amp;lt;/b&amp;gt; - Secure Copy Protocol&lt;br /&gt;
:- SCP can only be used for transferring files, and is not interactive (everything has to be specified on the command line).&lt;br /&gt;
* &amp;lt;b&amp;gt;[[SFTP|SFTP]]&amp;lt;/b&amp;gt; - Secure File Transfer Protocol&lt;br /&gt;
:- More elaborate, and allows interactive commands to do things like creating directories, deleting directories and files (all subject to system permissions, ofc), etc. &lt;br /&gt;
:- Allows for a range of operations on remote files - it is more like a remote file system protocl. An SFTP client&amp;#039;s extra capabilities compared to an SCP client include resuming interrupted transfers, directory listings, and remote file removal.  &lt;br /&gt;
&lt;br /&gt;
Both SCP and SFTP utilize the same SSH encryption during file transfer with the same general level of overhead, &amp;lt;b&amp;gt;SCP is usually much faster than SFTP at transferring files&amp;lt;/b&amp;gt;, especially on high latency networks. This is because SCP implements a more efficient transfer algorithm, one which does not require waiting for packet confirmations. This leads to faster speed but comes at the expense of not being able to interrupt a transfer, so unlike SFTP, SCP transfer cannot be canceled without terminating the session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to SSH without Keypairs, and use Password Authentication instead====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-password-login/&lt;br /&gt;
&lt;br /&gt;
https://www.serverkaka.com/2018/08/enable-password-authentication-aws-ec2-instance.html&lt;br /&gt;
&lt;br /&gt;
====SSH Troubleshooting====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are some of the common errors or issues you may run into with SSH:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Server refused our key=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You might be unable to log in to an EC2 instance if:&lt;br /&gt;
* You&amp;#039;re using an SSH private key but the corresponding public key is not in the authorized_keys file.&lt;br /&gt;
* You don&amp;#039;t have permissions for your authorized_keys file.&lt;br /&gt;
* You don&amp;#039;t have permissions for the .ssh folder.&lt;br /&gt;
* Your authorized_keys file or .ssh folder isn&amp;#039;t named correctly.&lt;br /&gt;
* Your authorized_keys file or .ssh folder was deleted.&lt;br /&gt;
* Your instance was launched without a key, or it was launched with an incorrect key.&lt;br /&gt;
&lt;br /&gt;
To connect to your EC2 instance after receiving the error &amp;quot;Server refused our key,&amp;quot; you can update the instance&amp;#039;s user data to append the specified SSH public key to the authorized_keys file, which sets the appropriate ownership and file permissions for the SSH directory and files contained in it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Server refused public-key signature despite accepting key!=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Could be due to:&lt;br /&gt;
* Could be due to changed permissions on the .ssh directory, the authorized_keys file, or even the home directories. Check permissions.&lt;br /&gt;
* Firewall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Permission denied=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check permissions!&lt;br /&gt;
Make sure you are using the correct user name, correct key, correct host, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Connection Timeout || Connection Timed out=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A connection timeout indicates that the client attempted to establish a network socket to the SSH server, but the server failed to respond within the timeout period.&lt;br /&gt;
&lt;br /&gt;
* Ensure the destination host is correct&lt;br /&gt;
* Check firewall/security groups. &lt;br /&gt;
* Check the ports you are using or the service is listening on ($ grep -i port /etc/ssh/sshd_config).&lt;br /&gt;
* Check that the service is actually running and bound to the expected port. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Connection Refused=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means the request is routed to the host, but the host does not successfully accept the request.&lt;br /&gt;
* Ensure the destination host is correct&lt;br /&gt;
* Check firewall/security groups. &lt;br /&gt;
* Check the ports you are using or the service is listening on ($ grep -i port /etc/ssh/sshd_config).&lt;br /&gt;
* Check that the service is actually running and bound to the expected port. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Too Many Authentication Failures=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This could happen if you have (default on my system) five or more DSA/RSA identity files stored in your .ssh directory. In this case if the -i option isn&amp;#039;t specified at the command line the ssh client will first attempt to login using each identity (private key) and next prompt for password authentication. However, sshd drops the connection after five bad login attempts (again default may vary).&lt;br /&gt;
&lt;br /&gt;
I was able to solve this issue by editing the &amp;lt;b&amp;gt;~/.ssh/config&amp;lt;/b&amp;gt; file on the local machine.&lt;br /&gt;
&lt;br /&gt;
Added this line:&lt;br /&gt;
 Host *&lt;br /&gt;
          IdentitiesOnly=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And it worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Copied my private key to another EC2 instance/Bastion, but now when I ssh to another instance I&amp;#039;m getting asked for a passphrase when I shouldn&amp;#039;t be=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://serverfault.com/questions/379938/ec2-instance-always-ask-me-to-enter-passphrase-for-the-pem-during-connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If sharing a private key between 2 or more ec2 instances and if you try to establish a ssh connection from a ssh connection on ec2, use notepad to open .pem file on your local machine and copy the contents to the new .pem file you&amp;#039;re creating in the ssh terminal. It will work 100% and won&amp;#039;t ask you for any passphrase.&lt;br /&gt;
&lt;br /&gt;
If you open your local .pem file with other text editors i.e. VSCode you will be asked for the passphrase when trying to use your new .pem file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check if the key is OK run: &amp;lt;b&amp;gt;openssl rsa -check -in test.pem -noout&amp;lt;/b&amp;gt; like so:&lt;br /&gt;
 # Bad key:&lt;br /&gt;
 openssl rsa -check -in .ssh/ec2_nva_key.pem -noout&lt;br /&gt;
 unable to load Private Key&lt;br /&gt;
 139794998015904:error:0906D066:PEM routines:PEM_read_bio:bad end line:pem_lib.c:815:&lt;br /&gt;
 &lt;br /&gt;
 # Good key:&lt;br /&gt;
 openssl rsa -check -in .ssh/ec2_nva_key.pem -noout&lt;br /&gt;
 RSA key ok&lt;br /&gt;
&lt;br /&gt;
=====How to connect to a RHEL 8 system running FIPS using PuTTY=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
RHEL 8: https://access.redhat.com/solutions/4906221&lt;br /&gt;
&lt;br /&gt;
More FIPS (How can I make RHEL 6 or RHEL 7 FIPS 140-2 compliant?  https://access.redhat.com/solutions/137833 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to regain SSH access to an EC2 instance using User Data====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://aws.amazon.com/premiumsupport/knowledge-center/user-data-replace-key-pair-ec2/&lt;br /&gt;
&lt;br /&gt;
1.    Create a new key pair.&lt;br /&gt;
&lt;br /&gt;
2.    If you create the private key in the Amazon EC2 console, retrieve the public key for the key pair.&lt;br /&gt;
&lt;br /&gt;
3.    Open the Amazon EC2 console.&lt;br /&gt;
&lt;br /&gt;
4.    Stop your instance.&lt;br /&gt;
&lt;br /&gt;
5.    Choose Actions, Instance Settings, and then choose View/Change User Data.&lt;br /&gt;
&lt;br /&gt;
6.    Copy the following script into the View/Change User Data dialog box:&lt;br /&gt;
 Content-Type: multipart/mixed; boundary=&amp;quot;//&amp;quot;&lt;br /&gt;
 MIME-Version: 1.0 &lt;br /&gt;
 &lt;br /&gt;
 --//&lt;br /&gt;
 Content-Type: text/cloud-config; charset=&amp;quot;us-ascii&amp;quot;&lt;br /&gt;
 MIME-Version: 1.0&lt;br /&gt;
 Content-Transfer-Encoding: 7bit&lt;br /&gt;
 Content-Disposition: attachment; filename=&amp;quot;cloud-config.txt&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 #cloud-config&lt;br /&gt;
 cloud_final_modules:&lt;br /&gt;
 - [users-groups, once]&lt;br /&gt;
 users:&lt;br /&gt;
   - name: username&lt;br /&gt;
     ssh-authorized-keys: &lt;br /&gt;
     - PublicKeypair&lt;br /&gt;
&lt;br /&gt;
Replace username with your user name, such as ec2-user. You can enter the default user name, or enter a custom user name, if one was previously set up for the instance. For a list of default user names, see General prerequisites for connecting to your instance.&lt;br /&gt;
&lt;br /&gt;
Replace PublicKeypair with the public key retrieved in step 2. Be sure to enter the entire public key, starting with ssh-rsa.&lt;br /&gt;
&lt;br /&gt;
7.    Choose Save.&lt;br /&gt;
&lt;br /&gt;
8.    Start your instance.&lt;br /&gt;
&lt;br /&gt;
9.    After the cloud-init phase is complete, validate that the public key was replaced.&lt;br /&gt;
&lt;br /&gt;
Important: Because the script contains a key pair, remove the script from the User Data field.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: Notice the [users-groups, once] -- This will only run the user-data script once, which is the next boot up. If you want to run this again, you can change &amp;lt;i&amp;gt;once&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;always&amp;lt;/i&amp;gt;. So be sure to remove the script from the User Data Field once you regain access. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANOTHER GUIDE USING USER DATA SPECIFICALLY FOR PERMISSIONS DENIED ERROR (&amp;lt;b&amp;gt;This didn&amp;#039;t work for me after testing a couple times though&amp;lt;/b&amp;gt;): https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-fix-permission-denied-errors/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
References: &lt;br /&gt;
[+] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-server-refused-our-key/&lt;br /&gt;
[+] https://serverfault.com/questions/716033/gitlab-server-refused-public-key-signature-despite-accepting-key-on-a-valid&lt;br /&gt;
[+] https://serverfault.com/questions/837981/too-many-authentication-failures-for-ec2-user&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to set up SSH Agent Forwarding (for Bastion hosts)====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Really good article, very easy:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Securely Connect to Linux Instances Running in a Private Amazon VPC&amp;lt;/u&amp;gt;:&lt;br /&gt;
https://aws.amazon.com/blogs/security/securely-connect-to-linux-instances-running-in-a-private-amazon-vpc/&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Configuring SSH Agent Forwarding in Windows Subsystem for Linux (Ubuntu 18.04)&amp;lt;/u&amp;gt;:&lt;br /&gt;
https://stfc-cloud-docs.readthedocs.io/en/latest/howto/ConfigureSSHAgentForwardingInWindowsSubsystemForLinux.html&lt;br /&gt;
&lt;br /&gt;
To update Ubuntu 18.04 LTS run:&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
This left me with a nice up to date install. You can then run the following commands to start and add your key to the ssh agent:&lt;br /&gt;
 # To get the environment variables set in the user&amp;#039;s shell environment and start the agent:&lt;br /&gt;
 eval $(ssh-agent -s)&lt;br /&gt;
 ssh-add \&amp;lt;path-to-your-ssh-private-key\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can ssh to your &amp;lt;b&amp;gt;Bastion&amp;lt;/b&amp;gt; host with agent forwarding using:&lt;br /&gt;
 ssh -A ec2-user@&amp;lt;public_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can SSH to your instances in the private subnet:&lt;br /&gt;
 ssh ec2-user@&amp;lt;private_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt;: You can view the private keys that were added to the agent:&lt;br /&gt;
 $ ssh-add -l&lt;br /&gt;
 2048 SHA256:naYvKCfcR+qJXL9A6YiohfaxpjjKEK4G4dW2rAcxLgg .ssh/ohio_key_for_home.pem (RSA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Another good link: https://www.ssh.com/ssh/agent&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>