{"id":334,"date":"2010-01-06T14:30:44","date_gmt":"2010-01-06T12:30:44","guid":{"rendered":"http:\/\/nico-maas.de\/wordpress\/?p=334"},"modified":"2010-01-06T14:30:44","modified_gmt":"2010-01-06T12:30:44","slug":"ssh-tunneling","status":"publish","type":"post","link":"https:\/\/www.nico-maas.de\/?p=334","title":{"rendered":"SSH Tunneling"},"content":{"rendered":"<p>One of the most important things by working in \"dangerous\" Networking Enviroments is protection.<\/p>\n<p>And by that I don't mean the usual (and important!) Anti Virus, Anti Malware and Firewall Software, but Traffic Tunneling, meaning VPN or SSH.<\/p>\n<p>SSH is the secure equivalent to the good old (and Plaintext transmitted) Telnet. And its also more powerful: Its use is not limited to remote Control, but can also provide an secured Datatunnel through which all your Traffic to your Remote Location (i.e. an Mysql Database, Web- or Mailserver or the Web itself) is tunneld - and encrypted. Giving therefore little to no chance to \"Wiresharkes\" and other Cable Tappers or Span Users.<\/p>\n<p>So lets go:<\/p>\n<p>1. Setting up the SSH Server<br \/>\nSetting up an ssh Server is as simple as:<br \/>\napt-get install openssh-server<br \/>\nif you're running Debian or Ubuntu.<\/p>\n<p>Optional you can configure that the \"root\" Account<br \/>\nwon't be able to access via ssh and you can configure that<br \/>\nPlaintext Passwords aren't allowed. We will go for an Keybased Setup here,<br \/>\nbut I would recommend not shutting down this Plaintext Password Authentification<br \/>\nif you can't access the machine physically easily (as the Certifactes are only valid<br \/>\nfor one year...).<\/p>\n<p>2. Configuring the SSH Server<br \/>\nvi \/etc\/ssh\/sshd_config<\/p>\n<p>- change Port to 18000<br \/>\nPort 18000<br \/>\n\/\/ Thats an must!<\/p>\n<p>- deactivate root access<br \/>\nPermitRootLogin yes<br \/>\n\/\/ Thats optional, it does NOT allow your root Account to login via SSH.<br \/>\n\/\/ Only set that if you know what you're doing!<\/p>\n<p>- deactivate password login<br \/>\nPasswordAuthentication no<br \/>\n\/\/ Thats optional as well, you can set that after this whole thing,<br \/>\n\/\/ as you have working SSH Key Authentification - but beware,<br \/>\n\/\/ you won't be able to login via an Password then!<br \/>\n\/\/ ( And that will hurt if your Keys are expired and don't work anymore... )<\/p>\n<p>3. Configure Router (NAT and Firewall) to Allow Access to your SSH Server.<br \/>\nUse Dynamic DNS (i.E. DynDNS.org) to get an Dynamic DNS Adress.<br \/>\n( Means that an adress like myserver.dyndns.org will always point to<br \/>\nyour dynamically changing IP Adress of your Router. Most Routers have an<br \/>\nDynDNS Client built in, so they update the DynDNS Account on every IP Change -<br \/>\nlook it up in the Handbook \/ Config Menu)<\/p>\n<p>4. Setting up an SSH User with Restricted Shell Access<br \/>\nsudo apt-get install rssh<br \/>\n\/\/ Installs the restricted shell<br \/>\nsudo useradd tunnel -m -s \/usr\/bin\/rssh<br \/>\n\/\/ Creates an User named tunnel with the Restricted Shell<br \/>\nsudo passwd tunnel<br \/>\n\/\/ Enter the Password you want for the User<\/p>\n<p>5. Setting up Squid HTTP Proxy<br \/>\nsudo apt-get install squid<\/p>\n<p>6. Creating the Connection using Putty and Setting up the Clients<br \/>\nDownload the Putty installer from<br \/>\nhttp:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html<br \/>\nand install. Then open Putty:<\/p>\n<p>Session -&gt; Hostname and Port: Enter your DynDNS Adress and the Port you chose for SSH<br \/>\nConnection -&gt; Enable TCP Keepalives<br \/>\nConnection -&gt; SSH -&gt; Don't start a shell or command at all<br \/>\nConnection -&gt; SSH -&gt; Enable compression<br \/>\nConnection -&gt; SSH -&gt; Tunnels: Source Port you can choose i.E. 20000<br \/>\n\/\/ Source Port is the Port the Tunnel will end on your \"Client PC\"<br \/>\nConnection -&gt; SSH -&gt; Tunnels: Destination Port localhost:3128<br \/>\n\/\/ Destination Port is in that Case the Server (localhost) and Port 3128<br \/>\n\/\/ which is the Squid Proxy. But it could also be something like<br \/>\n\/\/ IPofyourRouter:21 to forward the Telnet of your Router to Port 20000 on<br \/>\n\/\/ the Remote PC, or IporNameofyourHomePc:3389 to forward the Windows<br \/>\n\/\/ Remote Desktop - or anything else. You would then connect with the<br \/>\n\/\/ Remote Desktop Tool to \"localhost:20000\" to Access your PC at Home.<br \/>\nSession -&gt; Press Save and Save the Session<br \/>\nSession -&gt; Press Open and Enter your Login, i.E. tunnel and password<\/p>\n<p>You won't see anything as it stays open and \"nothing happens\".<\/p>\n<p>Go to your Internet Explorer \\ Firefox and enter as Proxy localhost, Port 20000<\/p>\n<p>Internet Explorer:<br \/>\nExtras, Internetoptions, Lan Settings, Choose Proxy Server for Lan<br \/>\nEnter localhost, Port 20000<\/p>\n<p>Firefox:<br \/>\nExtras, Settings, Advanced, Network, Settings<br \/>\nManual Proxy Configuration, HTTP Proxy: localhost, Port 20000<br \/>\nFor all Protocols<\/p>\n<p>And now you'll be able to surf the Web Securely from everywhere through your<br \/>\nsecured Tunnel!<\/p>\n<p>WARNING: ONLY the Traffic is secured. Your DNS Lookups STILL go to your local<br \/>\nDNS Server. So i.e. the Local DNS Admin can see that you were surfing on<br \/>\ni.e. Google, Facebook or so - but can't see what you did transmit there.<br \/>\nTo change that and to do DNS also tunneled via SSH do this:.<\/p>\n<p>Internet Explorer:<br \/>\ndon't know, isn't working<\/p>\n<p>Firefox:<br \/>\n\/\/ Enter in the URL Bar:<br \/>\nabout:config<br \/>\n\/\/ Look for this string and set it to \"true\"<br \/>\nnetwork.proxy.socks_remote_dns<\/p>\n<p>Only one thing to do left:<br \/>\nSet Keybased Authentification.<br \/>\nKeybased Authentification has two main Advantages:<br \/>\na) You can use it allow scripts to identify themselfes via the key and use ssh<br \/>\nb) Its more secure as the Key does check its Serverpart and tells you if you're<br \/>\nconnection has been redirected or intercepted. Its the way to go.<\/p>\n<p>Creating keys:<br \/>\nsu<br \/>\n\/\/ Enter password for root Access<br \/>\nssh-keygen -t rsa -b 2048<br \/>\nJust \"enter\" through everything<\/p>\n<p>Installing keys:<br \/>\ncd \/home\/tunnel\/<br \/>\nmkdir .ssh<br \/>\nchmod 700 .ssh\/<br \/>\ncd .ssh\/<br \/>\ntouch authorized_keys<br \/>\ncat ~\/.ssh\/id_rsa.pub &gt; authorized_keys<br \/>\nchmod 600 authorized_keys<br \/>\ncd ..<br \/>\nchmod 700 .ssh\/<br \/>\nchown tunnel -R .ssh\/<br \/>\nexit<\/p>\n<p>Download the key id_rsa in \/root\/.ssh\/ via WinSCP to your PC<br \/>\nStartup puttygen which you did gain with the Putty installer.<br \/>\nLoad the id_rsa in Putty and press on \"Save Private Key\"<\/p>\n<p>Using key based Authentification with Putty:<br \/>\nOpen Putty and load your Preset<br \/>\nConnection -&gt; SSH -&gt; Auth<br \/>\nAnd use the \"Private Key File for Authentification\" to point to your previously<br \/>\nset Private Key (wheter encrypted or not isn't important at this Point).<br \/>\nGo again to Session and Save again. Press Open.<br \/>\nYou'll be asked to enter your Username and Passphrase (if you got one).<br \/>\nIf you want to really automate that, you can even specify your Username in<br \/>\nPutty under SSH -&gt; Connection -&gt; Data \"Auto Login Name\"<\/p>\n<div class=\"shariff shariff-align-left shariff-widget-align-left\"><ul class=\"shariff-buttons theme-round orientation-horizontal buttonsize-small\"><li class=\"shariff-button printer shariff-nocustomcolor\" style=\"background-color:#a8a8a8\"><a href=\"javascript:window.print()\" title=\"print\" aria-label=\"print\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#999; color:#fff\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 30 32\"><path fill=\"#999\" d=\"M6.8 27.4h16v-4.6h-16v4.6zM6.8 16h16v-6.8h-2.8q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-11.4v11.4zM27.4 17.2q0-0.5-0.3-0.8t-0.8-0.4-0.8 0.4-0.3 0.8 0.3 0.8 0.8 0.3 0.8-0.3 0.3-0.8zM29.7 17.2v7.4q0 0.2-0.2 0.4t-0.4 0.2h-4v2.8q0 0.7-0.5 1.2t-1.2 0.5h-17.2q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-4q-0.2 0-0.4-0.2t-0.2-0.4v-7.4q0-1.4 1-2.4t2.4-1h1.2v-9.7q0-0.7 0.5-1.2t1.2-0.5h12q0.7 0 1.6 0.4t1.3 0.8l2.7 2.7q0.5 0.5 0.9 1.4t0.4 1.6v4.6h1.1q1.4 0 2.4 1t1 2.4z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button mailto shariff-nocustomcolor\" style=\"background-color:#a8a8a8\"><a href=\"mailto:?body=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&subject=SSH%20Tunneling\" title=\"Send by email\" aria-label=\"Send by email\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#999; color:#fff\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#999\" d=\"M32 12.7v14.2q0 1.2-0.8 2t-2 0.9h-26.3q-1.2 0-2-0.9t-0.8-2v-14.2q0.8 0.9 1.8 1.6 6.5 4.4 8.9 6.1 1 0.8 1.6 1.2t1.7 0.9 2 0.4h0.1q0.9 0 2-0.4t1.7-0.9 1.6-1.2q3-2.2 8.9-6.1 1-0.7 1.8-1.6zM32 7.4q0 1.4-0.9 2.7t-2.2 2.2q-6.7 4.7-8.4 5.8-0.2 0.1-0.7 0.5t-1 0.7-0.9 0.6-1.1 0.5-0.9 0.2h-0.1q-0.4 0-0.9-0.2t-1.1-0.5-0.9-0.6-1-0.7-0.7-0.5q-1.6-1.1-4.7-3.2t-3.6-2.6q-1.1-0.7-2.1-2t-1-2.5q0-1.4 0.7-2.3t2.1-0.9h26.3q1.2 0 2 0.8t0.9 2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&text=SSH%20Tunneling\" title=\"Share on X\" aria-label=\"Share on X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on Facebook\" aria-label=\"Share on Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button linkedin shariff-nocustomcolor\" style=\"background-color:#1488bf\"><a href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on LinkedIn\" aria-label=\"Share on LinkedIn\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0077b5; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 27 32\"><path fill=\"#0077b5\" d=\"M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on Reddit\" aria-label=\"Share on Reddit\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button pinterest shariff-nocustomcolor\" style=\"background-color:#e70f18\"><a href=\"https:\/\/www.pinterest.com\/pin\/create\/link\/?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&media=https%3A%2F%2Fwww.nico-maas.de%2Fwordpress%2Fwp-content%2Fplugins%2Fshariff%2Fimages%2FdefaultHint.png&description=SSH%20Tunneling\" title=\"Pin it on Pinterest\" aria-label=\"Pin it on Pinterest\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#cb2027; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 27 32\"><path fill=\"#cb2027\" d=\"M27.4 16q0 3.7-1.8 6.9t-5 5-6.9 1.9q-2 0-3.9-0.6 1.1-1.7 1.4-2.9 0.2-0.6 1-3.8 0.4 0.7 1.3 1.2t2 0.5q2.1 0 3.8-1.2t2.7-3.4 0.9-4.8q0-2-1.1-3.8t-3.1-2.9-4.5-1.2q-1.9 0-3.5 0.5t-2.8 1.4-2 2-1.2 2.3-0.4 2.4q0 1.9 0.7 3.3t2.1 2q0.5 0.2 0.7-0.4 0-0.1 0.1-0.5t0.2-0.5q0.1-0.4-0.2-0.8-0.9-1.1-0.9-2.7 0-2.7 1.9-4.6t4.9-2q2.7 0 4.2 1.5t1.5 3.8q0 3-1.2 5.2t-3.1 2.1q-1.1 0-1.7-0.8t-0.4-1.9q0.1-0.6 0.5-1.7t0.5-1.8 0.2-1.4q0-0.9-0.5-1.5t-1.4-0.6q-1.1 0-1.9 1t-0.8 2.6q0 1.3 0.4 2.2l-1.8 7.5q-0.3 1.2-0.2 3.2-3.7-1.6-6-5t-2.3-7.6q0-3.7 1.9-6.9t5-5 6.9-1.9 6.9 1.9 5 5 1.8 6.9z\"\/><\/svg><\/span><\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>One of the most important things by working in \"dangerous\" Networking Enviroments is protection. And by that I don't mean the usual (and important!) Anti Virus, Anti Malware and Firewall Software, but Traffic Tunneling, meaning VPN or SSH. SSH is the secure equivalent to the good old (and Plaintext transmitted) Telnet. And its also more &hellip; <a href=\"https:\/\/www.nico-maas.de\/?p=334\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SSH Tunneling<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"shariff shariff-align-left shariff-widget-align-left\"><ul class=\"shariff-buttons theme-round orientation-horizontal buttonsize-small\"><li class=\"shariff-button printer shariff-nocustomcolor\" style=\"background-color:#a8a8a8\"><a href=\"javascript:window.print()\" title=\"print\" aria-label=\"print\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#999; color:#fff\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 30 32\"><path fill=\"#999\" d=\"M6.8 27.4h16v-4.6h-16v4.6zM6.8 16h16v-6.8h-2.8q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-11.4v11.4zM27.4 17.2q0-0.5-0.3-0.8t-0.8-0.4-0.8 0.4-0.3 0.8 0.3 0.8 0.8 0.3 0.8-0.3 0.3-0.8zM29.7 17.2v7.4q0 0.2-0.2 0.4t-0.4 0.2h-4v2.8q0 0.7-0.5 1.2t-1.2 0.5h-17.2q-0.7 0-1.2-0.5t-0.5-1.2v-2.8h-4q-0.2 0-0.4-0.2t-0.2-0.4v-7.4q0-1.4 1-2.4t2.4-1h1.2v-9.7q0-0.7 0.5-1.2t1.2-0.5h12q0.7 0 1.6 0.4t1.3 0.8l2.7 2.7q0.5 0.5 0.9 1.4t0.4 1.6v4.6h1.1q1.4 0 2.4 1t1 2.4z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button mailto shariff-nocustomcolor\" style=\"background-color:#a8a8a8\"><a href=\"mailto:?body=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&subject=SSH%20Tunneling\" title=\"Send by email\" aria-label=\"Send by email\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#999; color:#fff\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#999\" d=\"M32 12.7v14.2q0 1.2-0.8 2t-2 0.9h-26.3q-1.2 0-2-0.9t-0.8-2v-14.2q0.8 0.9 1.8 1.6 6.5 4.4 8.9 6.1 1 0.8 1.6 1.2t1.7 0.9 2 0.4h0.1q0.9 0 2-0.4t1.7-0.9 1.6-1.2q3-2.2 8.9-6.1 1-0.7 1.8-1.6zM32 7.4q0 1.4-0.9 2.7t-2.2 2.2q-6.7 4.7-8.4 5.8-0.2 0.1-0.7 0.5t-1 0.7-0.9 0.6-1.1 0.5-0.9 0.2h-0.1q-0.4 0-0.9-0.2t-1.1-0.5-0.9-0.6-1-0.7-0.7-0.5q-1.6-1.1-4.7-3.2t-3.6-2.6q-1.1-0.7-2.1-2t-1-2.5q0-1.4 0.7-2.3t2.1-0.9h26.3q1.2 0 2 0.8t0.9 2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&text=SSH%20Tunneling\" title=\"Share on X\" aria-label=\"Share on X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on Facebook\" aria-label=\"Share on Facebook\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button linkedin shariff-nocustomcolor\" style=\"background-color:#1488bf\"><a href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on LinkedIn\" aria-label=\"Share on LinkedIn\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0077b5; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 27 32\"><path fill=\"#0077b5\" d=\"M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334\" title=\"Share on Reddit\" aria-label=\"Share on Reddit\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><\/a><\/li><li class=\"shariff-button pinterest shariff-nocustomcolor\" style=\"background-color:#e70f18\"><a href=\"https:\/\/www.pinterest.com\/pin\/create\/link\/?url=https%3A%2F%2Fwww.nico-maas.de%2F%3Fp%3D334&media=https%3A%2F%2Fwww.nico-maas.de%2Fwordpress%2Fwp-content%2Fplugins%2Fshariff%2Fimages%2FdefaultHint.png&description=SSH%20Tunneling\" title=\"Pin it on Pinterest\" aria-label=\"Pin it on Pinterest\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#cb2027; color:#fff\" target=\"_blank\"><span class=\"shariff-icon\" style=\"\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 27 32\"><path fill=\"#cb2027\" d=\"M27.4 16q0 3.7-1.8 6.9t-5 5-6.9 1.9q-2 0-3.9-0.6 1.1-1.7 1.4-2.9 0.2-0.6 1-3.8 0.4 0.7 1.3 1.2t2 0.5q2.1 0 3.8-1.2t2.7-3.4 0.9-4.8q0-2-1.1-3.8t-3.1-2.9-4.5-1.2q-1.9 0-3.5 0.5t-2.8 1.4-2 2-1.2 2.3-0.4 2.4q0 1.9 0.7 3.3t2.1 2q0.5 0.2 0.7-0.4 0-0.1 0.1-0.5t0.2-0.5q0.1-0.4-0.2-0.8-0.9-1.1-0.9-2.7 0-2.7 1.9-4.6t4.9-2q2.7 0 4.2 1.5t1.5 3.8q0 3-1.2 5.2t-3.1 2.1q-1.1 0-1.7-0.8t-0.4-1.9q0.1-0.6 0.5-1.7t0.5-1.8 0.2-1.4q0-0.9-0.5-1.5t-1.4-0.6q-1.1 0-1.9 1t-0.8 2.6q0 1.3 0.4 2.2l-1.8 7.5q-0.3 1.2-0.2 3.2-3.7-1.6-6-5t-2.3-7.6q0-3.7 1.9-6.9t5-5 6.9-1.9 6.9 1.9 5 5 1.8 6.9z\"\/><\/svg><\/span><\/a><\/li><\/ul><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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}},"categories":[32,18],"tags":[102,101,99,100,46],"class_list":["post-334","post","type-post","status-publish","format-standard","hentry","category-network","category-unix-linux","tag-debian","tag-squid","tag-ssh","tag-tunnel","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/piXYf-5o","jetpack-related-posts":[{"id":1317,"url":"https:\/\/www.nico-maas.de\/?p=1317","url_meta":{"origin":334,"position":0},"title":"[Ubuntu] Use Molly-Guard to stop shooting your own leg","author":"Nico Maas","date":"23. September 2016","format":false,"excerpt":"If you're working on some dozens of linux servers (or even more than 100,.. as in my case), you end up doing administration via SSH - which is the way to go. And chances are, that you'll get dozens of SSH connections open in dozens of tabs and you did\u2026","rel":"","context":"In &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/www.nico-maas.de\/?cat=415"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1068,"url":"https:\/\/www.nico-maas.de\/?p=1068","url_meta":{"origin":334,"position":1},"title":"SSH Socks Proxy","author":"Nico Maas","date":"23. March 2015","format":false,"excerpt":"Very easy and handy is to use an SSH Server as Socks Proxy: ssh -D 8080 username@my_ssh_server Or use Putty: Enter the IP Address of your SSH Server, Port and go to Connection -> SSH -> Tunnels. In Source Port enter the Port where the Proxy should be available. I.e.\u2026","rel":"","context":"In &quot;Computer&quot;","block_context":{"text":"Computer","link":"https:\/\/www.nico-maas.de\/?cat=4"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1533,"url":"https:\/\/www.nico-maas.de\/?p=1533","url_meta":{"origin":334,"position":2},"title":"SSH config for beginners","author":"Nico Maas","date":"18. April 2017","format":false,"excerpt":"The SSH config is a powerful tool to get \"more\" out of your normal SSH connection. Just create an file called \"config\" in your .ssh folder and it will be used on a new SSH session. Lets start with a simple example of how a connection configuration could look like:\u2026","rel":"","context":"In &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/www.nico-maas.de\/?cat=415"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1039,"url":"https:\/\/www.nico-maas.de\/?p=1039","url_meta":{"origin":334,"position":3},"title":"[Linux] Delete old SSH Keys and recreate them","author":"Nico Maas","date":"14. March 2015","format":false,"excerpt":"If you are downloading an Linux Image for i.e. Embedded Systems like Raspberry Pi, sometimes, the SSH Keys are still on the system and are not recreated. To do that manually, just enter: sudo rm \/etc\/ssh\/ssh_host_* sudo dpkg-reconfigure openssh-server sudo service ssh restart","rel":"","context":"In &quot;Raspberry Pi&quot;","block_context":{"text":"Raspberry Pi","link":"https:\/\/www.nico-maas.de\/?cat=280"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":337,"url":"https:\/\/www.nico-maas.de\/?p=337","url_meta":{"origin":334,"position":4},"title":"Remote Desktop with XDMCP on Ubuntu 9.10","author":"Nico Maas","date":"7. January 2010","format":false,"excerpt":"To access the unsecured(!) Remote Desktop of an Ubuntu 9.10 installation, you need following: First, install the openssh-server: sudo apt-get install openssh-server Then, you need to enable the XDMCP Server. That became a bit tricky on that Installation, as the \"Point 'n Click\" enabling has been removed. Dunno why. So,\u2026","rel":"","context":"In &quot;Network&quot;","block_context":{"text":"Network","link":"https:\/\/www.nico-maas.de\/?cat=32"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1530,"url":"https:\/\/www.nico-maas.de\/?p=1530","url_meta":{"origin":334,"position":5},"title":"SSH and Git on Windows (with Public\\Private Key Authentication)","author":"Nico Maas","date":"12. April 2017","format":false,"excerpt":"This Blog Post consists in huge parts of Daniel H\u00fcskens awesome work, but I still had to rewrite it a bit as I tended to add some stuff on :). 1.) Download latest Git for Windows:\u00a0https:\/\/git-for-windows.github.io\/ 2.) Install (Entires with * can be changed to your own liking, ** can\u2026","rel":"","context":"In &quot;Security&quot;","block_context":{"text":"Security","link":"https:\/\/www.nico-maas.de\/?cat=415"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=334"}],"version-history":[{"count":2,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/posts\/334\/revisions"}],"predecessor-version":[{"id":336,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=\/wp\/v2\/posts\/334\/revisions\/336"}],"wp:attachment":[{"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nico-maas.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}