<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=SSHwithBASTION</id>
	<title>SSHwithBASTION - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.slacam.com.br/index.php?action=history&amp;feed=atom&amp;title=SSHwithBASTION"/>
	<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=SSHwithBASTION&amp;action=history"/>
	<updated>2026-11-17T00:37:41Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=SSHwithBASTION&amp;diff=866&amp;oldid=prev</id>
		<title>Machado em 00h50min de 14 de abril de 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=SSHwithBASTION&amp;diff=866&amp;oldid=prev"/>
		<updated>2016-04-14T00:50:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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;pt-BR&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Edição anterior&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Edição das 00h50min de 14 de abril de 2016&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-l5&quot; &gt;Linha 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;1 - Gere as chaves normalmente e coloque a sua chave pública nos HostB e HostC;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;1 - Gere as chaves normalmente e coloque a sua chave pública nos HostB e HostC;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;2 - Como o HostB será o gateway de passagem configure em /etc/ssh/sshd_config a entrada&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;2 - Como o HostB será o gateway de passagem configure em /etc/ssh/sshd_config a entrada&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;  PubkeyAuthentication yes   &lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  PubkeyAuthentication yes   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;3 - No seu HostA que será a origem certifique-se que não haja o ssh-agent rodando:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;3 - No seu HostA que será a origem certifique-se que não haja o ssh-agent rodando:&lt;/div&gt;&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-l32&quot; &gt;Linha 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linha 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;5 - Carregue a sua chave privada com o comando:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;5 - Carregue a sua chave privada com o comando:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  you#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;local&lt;/del&gt;$ ssh-add ~/.ssh/id_dsa&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  you#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;HostA&lt;/ins&gt;$ ssh-add ~/.ssh/id_dsa&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  Need passphrase for /home/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mah&lt;/del&gt;/.ssh/id_dsa (you@example.com).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  Need passphrase for /home/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;you&lt;/ins&gt;/.ssh/id_dsa (you@example.com).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;  Enter passphrase:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  Enter passphrase:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  you#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;local&lt;/del&gt;$&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  you#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;HostA&lt;/ins&gt;$&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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;6 - Para acessa diretamente o HostC use o comando:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;6 - Para acessa diretamente o HostC use o comando:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ssh -o ProxyCommand=&amp;#039;ssh -W %h:%p user@HostB&amp;#039; user@&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;HostCsdss4-apogee&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&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;  ssh -o ProxyCommand=&amp;#039;ssh -W %h:%p user@HostB&amp;#039; user@&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;HostC&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Machado</name></author>
	</entry>
	<entry>
		<id>https://wiki.slacam.com.br/index.php?title=SSHwithBASTION&amp;diff=865&amp;oldid=prev</id>
		<title>Machado: Criou página com &#039;Acessando Máquinas Remotas Usando SSH com Bastion Host (CentOS 7)  Essa dica é para possibilitar uma máquina que esteja atrás de outra, ou seja HostA -&gt; HostB -&gt; HostC. Si...&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.slacam.com.br/index.php?title=SSHwithBASTION&amp;diff=865&amp;oldid=prev"/>
		<updated>2016-04-14T00:48:18Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;Acessando Máquinas Remotas Usando SSH com Bastion Host (CentOS 7)  Essa dica é para possibilitar uma máquina que esteja atrás de outra, ou seja HostA -&amp;gt; HostB -&amp;gt; HostC. Si...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Acessando Máquinas Remotas Usando SSH com Bastion Host (CentOS 7)&lt;br /&gt;
&lt;br /&gt;
Essa dica é para possibilitar uma máquina que esteja atrás de outra, ou seja HostA -&amp;gt; HostB -&amp;gt; HostC. Siga então os passos:&lt;br /&gt;
&lt;br /&gt;
1 - Gere as chaves normalmente e coloque a sua chave pública nos HostB e HostC;&lt;br /&gt;
&lt;br /&gt;
2 - Como o HostB será o gateway de passagem configure em /etc/ssh/sshd_config a entrada&lt;br /&gt;
 PubkeyAuthentication yes  &lt;br /&gt;
3 - No seu HostA que será a origem certifique-se que não haja o ssh-agent rodando:&lt;br /&gt;
 ssh-add -D&lt;br /&gt;
 ssh-agent -k &lt;br /&gt;
4 - Rode o Script abaixo para iniciar o agente:&lt;br /&gt;
 SSH_ENV=&amp;quot;$HOME/.ssh/environment&amp;quot;&lt;br /&gt;
 function start_agent {&lt;br /&gt;
     echo &amp;quot;Initialising new SSH agent...&amp;quot;&lt;br /&gt;
     /usr/bin/ssh-agent | sed &amp;#039;s/^echo/#echo/&amp;#039; &amp;gt; &amp;quot;${SSH_ENV}&amp;quot;&lt;br /&gt;
     echo succeeded&lt;br /&gt;
     chmod 600 &amp;quot;${SSH_ENV}&amp;quot;&lt;br /&gt;
     . &amp;quot;${SSH_ENV}&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
     /usr/bin/ssh-add;&lt;br /&gt;
 }&lt;br /&gt;
 # Source SSH settings, if applicable&lt;br /&gt;
 if [ -f &amp;quot;${SSH_ENV}&amp;quot; ]; then&lt;br /&gt;
     . &amp;quot;${SSH_ENV}&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
     #ps ${SSH_AGENT_PID} doesn&amp;#039;t work under cywgin&lt;br /&gt;
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ &amp;gt; /dev/null || {&lt;br /&gt;
         start_agent;&lt;br /&gt;
     }&lt;br /&gt;
 else&lt;br /&gt;
     start_agent;&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
5 - Carregue a sua chave privada com o comando:&lt;br /&gt;
 you#local$ ssh-add ~/.ssh/id_dsa&lt;br /&gt;
 Need passphrase for /home/mah/.ssh/id_dsa (you@example.com).&lt;br /&gt;
 Enter passphrase:&lt;br /&gt;
 you#local$&lt;br /&gt;
&lt;br /&gt;
6 - Para acessa diretamente o HostC use o comando:&lt;br /&gt;
 ssh -o ProxyCommand=&amp;#039;ssh -W %h:%p user@HostB&amp;#039; user@HostCsdss4-apogee&lt;/div&gt;</summary>
		<author><name>Machado</name></author>
	</entry>
</feed>