{"id":35,"date":"2025-11-10T23:25:10","date_gmt":"2025-11-10T23:25:10","guid":{"rendered":"https:\/\/vyos.web.id\/?p=35"},"modified":"2025-11-10T23:26:35","modified_gmt":"2025-11-10T23:26:35","slug":"ssh-tunnel","status":"publish","type":"post","link":"https:\/\/vyos.web.id\/?p=35","title":{"rendered":"SSH Tunnel"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">1. You are using SSH key-based authentication<\/h3>\n\n\n\n<p>If the server already has your <strong>authorized_keys<\/strong> configured, then when you run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -D 1080 -C -q -N -p ( your ssh port )  yourusername@your_ip_ssh\n<\/code><\/pre>\n\n\n\n<p>\u2026and it doesn\u2019t ask for a password, it means the connection is successful because your SSH key is already recognized by the server.<\/p>\n\n\n\n<p>To check if the tunnel is actually active:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>netstat -tlnp | grep 1080\n<\/code><\/pre>\n\n\n\n<p>Or using <code>ss<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tlnp | grep 1080\n<\/code><\/pre>\n\n\n\n<p>You should see output like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tcp   LISTEN  0  128  127.0.0.1:1080  *:*  users:((\"ssh\",pid=xxxx,fd=3))\n<\/code><\/pre>\n\n\n\n<p>That means your SOCKS proxy is running on port <strong>1080<\/strong> \u2705<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 2. You\u2019re running SSH without a login shell (because of the <code>-N<\/code> option)<\/h3>\n\n\n\n<p>The <code>-N<\/code> option means <strong>no remote command or shell session<\/strong> will be opened, so you won\u2019t see any login prompt or output.<br>That\u2019s also <strong>normal<\/strong> \u2014 the tunnel stays active in the background.<\/p>\n\n\n\n<p>If you remove <code>-q<\/code> and <code>-N<\/code>, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -D 1080 -C -p (port) yourUsersername@your_ip_ssh_server\n<\/code><\/pre>\n\n\n\n<p>you\u2019ll enter the remote shell (you\u2019ll see the login prompt and normal SSH output).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd39 3. Check if the tunnel is really working<\/h3>\n\n\n\n<p>Try setting your browser as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SOCKS Host:<\/strong> <code>127.0.0.1<\/code><\/li>\n\n\n\n<li><strong>Port:<\/strong> <code>1080<\/code><\/li>\n\n\n\n<li><strong>SOCKS v5<\/strong><\/li>\n\n\n\n<li>Check <strong>\u201cProxy DNS through SOCKS v5\u201d<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Then open <a href=\"https:\/\/whatismyipaddress.com\/\">https:\/\/whatismyipaddress.com\/<\/a><br>\u2192 If your IP changes to your SSH server\u2019s IP, it means the tunnel is working properly. \u2705<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. You are using SSH key-based authentication If the server already has your authorized_keys configured, then when you run: \u2026and it doesn\u2019t ask for a password, it means the connection is successful because your SSH key is already recognized by the server. To check if the tunnel is actually active: Or using ss: You should [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-tipstriks-and-hacks"],"_links":{"self":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":3,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":38,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions\/38"}],"wp:attachment":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}