{"id":1566,"date":"2018-09-05T13:52:55","date_gmt":"2018-09-05T13:52:55","guid":{"rendered":"https:\/\/scunster.co.uk\/?p=1566"},"modified":"2018-09-05T14:02:16","modified_gmt":"2018-09-05T14:02:16","slug":"create-ssh-user-just-for-http-tunnel-using-private-key-authentification","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1566","title":{"rendered":"Create SSH user just for HTTP Tunnel using private key authentification"},"content":{"rendered":"<p>You may find the need to tunnel your internet traffic encrypted through a server that you own and trust. You can do this with a VPN but their IP addresses are often blacklisted and are also particularly slow. <\/p>\n<p>You may choose to do this for security, you may want to hide your torrent traffic from your ISP, you may want to appear to have a different IP address, perhaps to watch your UK TV while abroad maybe?<\/p>\n<p>If you have access to a VPS or dedicated server, even a standard PC running linux connected to the internet with a fast internet connection then here&#8217;s what you can do!<\/p>\n<p>First of all let&#8217;s create the tunnel user and restrict them to rbash only<\/p>\n<pre>useradd tunneluser1 -m -d \/home\/tunneluser1 -s \/bin\/rbash\r\npasswd tunneluser1<\/pre>\n<p>If you don&#8217;t use private \/ public keys then you&#8217;re all good to go with standard password based logon.<\/p>\n<p>Follow the guide for <a href=\"https:\/\/scunster.co.uk\/?p=1570\">using putty as a local HTTP(S) proxy<\/a> and you&#8217;re all set!<\/p>\n<p>If you want to use private \/ public keys then login as that user via shell and create the .ssh directory.<\/p>\n<pre>mkdir .ssh\r\nchmod 700 \/home\/tunneluser1\/.ssh<\/pre>\n<p>Now we need to create the authorized_keys file and paste the key information inside<\/p>\n<pre>vi \/home\/tunneluser1\/.ssh\/authorized_keys<\/pre>\n<p>Paste your key and save the file, then set the permission to 600<\/p>\n<pre>chmod 600 \/home\/tunneluser1\/.ssh\/authorized_keys<\/pre>\n<p>Finished, now follow the guide for <a href=\"https:\/\/scunster.co.uk\/?p=1570\">using putty as a local HTTP(S) proxy<\/a> and you&#8217;re all set!<br \/>\nHere is the guide for <a href=\"https:\/\/scunster.co.uk\/?p=1022\">creating private \/ public keypairs<\/a> using putty \/ puttygen<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may find the need to tunnel your internet traffic encrypted through a server that you own and trust. You can do this with a VPN but their IP addresses are often blacklisted and are also particularly slow. You may choose to do this for security, you may want to hide your torrent traffic from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[171,170],"tags":[427,428,425,426,234,423,424],"class_list":["post-1566","post","type-post","status-publish","format-standard","hentry","category-security-linux","category-security","tag-http","tag-https","tag-proxy","tag-putty","tag-ssh","tag-ssh2","tag-tunnel"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1566"}],"version-history":[{"count":4,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1566\/revisions"}],"predecessor-version":[{"id":1572,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1566\/revisions\/1572"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}