snipt

Ctrl+h for KB shortcuts

Bash

SSH via TOR using SOCAT

1
2
3
4
5
6
7
8
# start TOR
tor

# create tunnel
socat TCP-LISTEN:<port> SOCKS4A:localhost:<host>:22,socksport=9050

# login through local tunnel
ssh <user>@localhost -p <port>
https://snipt.net/embed/cc9af9f9e0f1f606c4125996ea1f05da/
/raw/cc9af9f9e0f1f606c4125996ea1f05da/
cc9af9f9e0f1f606c4125996ea1f05da
bash
Bash
8
2019-07-11T14:01:36
True
False
False
/api/public/snipt/12029/
ssh-via-tor-using-socat
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># start TOR</span> </span><span id="L-2"><a name="L-2"></a>tor </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># create tunnel</span> </span><span id="L-5"><a name="L-5"></a>socat TCP-LISTEN:&lt;port&gt; SOCKS4A:localhost:&lt;host&gt;:22,socksport<span class="o">=</span>9050 </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c1"># login through local tunnel</span> </span><span id="L-8"><a name="L-8"></a>ssh &lt;user&gt;@localhost -p &lt;port&gt; </span></pre></div> </td></tr></table>
socat, ssh, tor