{"id":15954,"date":"2026-06-15T10:33:49","date_gmt":"2026-06-15T02:33:49","guid":{"rendered":"https:\/\/pfchina.org\/?p=15954"},"modified":"2026-06-15T15:13:18","modified_gmt":"2026-06-15T07:13:18","slug":"%e9%80%82%e7%94%a8%e4%ba%8e-opnsense-%e7%9a%84-ttyd-%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/pfchina.org\/?p=15954","title":{"rendered":"\u9002\u7528\u4e8e OPNsense \u7684 ttyd \u63d2\u4ef6"},"content":{"rendered":"<p class=\"p1\" style=\"text-align: justify;\">\u5728\u7ba1\u7406 OPNsense \u9632\u706b\u5899\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u901a\u8fc7 SSH \u767b\u5f55\u7cfb\u7edf\u6267\u884c\u547d\u4ee4\u3001\u67e5\u770b\u65e5\u5fd7\u6216\u8005\u8fdb\u884c\u9ad8\u7ea7\u6545\u969c\u6392\u67e5\u3002\u867d\u7136 OPNsense \u63d0\u4f9b\u4e86\u5b8c\u5584\u7684 WebGUI\uff0c\u4f46\u5bf9\u4e8e\u4e60\u60ef\u4f7f\u7528\u547d\u4ee4\u884c\u7684\u7ba1\u7406\u5458\u6765\u8bf4\uff0c\u4e00\u4e2a\u96c6\u6210\u5728\u6d4f\u89c8\u5668\u4e2d\u7684\u7ec8\u7aef\u5f80\u5f80\u66f4\u52a0\u65b9\u4fbf\u3002ttyd \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7 Web Terminal \u9879\u76ee\uff0c\u53ef\u4ee5\u5c06\u672c\u5730\u7ec8\u7aef\u6620\u5c04\u5230\u6d4f\u89c8\u5668\u4e2d\uff0c\u5b9e\u73b0\u771f\u6b63\u7684 Web SSH \u4f53\u9a8c\u3002\u4e3a\u4e86\u65b9\u4fbf\u4f7f\u7528\uff0c\u6211\u5f00\u53d1\u4e86\u4e00\u4e2aOPNsense \u63d2\u4ef6\uff0c\u5b89\u88c5\u540e\u5373\u53ef\u901a\u8fc7\u6d4f\u89c8\u5668\u76f4\u63a5\u8bbf\u95ee\u7cfb\u7edf\u7ec8\u7aef\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u5f00\u53d1\u601d\u8def<\/h2>\n<p style=\"text-align: justify;\">\u4e3a\u4e86\u786e\u4fdd\u7cfb\u7edf\u7a33\u5b9a\uff0c\u4e0d\u5bf9 OPNSense \u9632\u706b\u5899\u9020\u6210\u5b89\u5168\u9690\u60a3\uff0c\u672c\u63d2\u4ef6\u9075\u5faa\u4ee5\u4e0b\u5f00\u53d1\u601d\u8def\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u4e0d\u901a\u8fc7 PHP \u6267\u884c\u7cfb\u7edf\u547d\u4ee4<\/li>\n<li>\u4e0d\u7ed5\u8fc7 pfSense \u8eab\u4efd\u8ba4\u8bc1<\/li>\n<li>\u4e0d\u81ea\u884c\u7ba1\u7406\u7528\u6237\u6743\u9650<\/li>\n<li>\u4e0d\u5b9e\u73b0\u989d\u5916\u7684 Shell \u73af\u5883<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u6d4f\u89c8\u5668\u8fde\u63a5\u540e\u5b9e\u9645\u6267\u884c\u7684\u662f\uff1a<\/p>\n<pre class=\"code\">sh printf \"login: \"; read -r user; ssh -tt \"$user@127.0.0.1\"<\/pre>\n<p style=\"text-align: justify;\">\u7528\u6237\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\u540e\uff0cttyd \u4f1a\u901a\u8fc7 SSH \u767b\u5f55\u672c\u673a\uff1a<\/p>\n<pre class=\"code\">127.0.0.1:22<\/pre>\n<p style=\"text-align: justify;\">\u56e0\u6b64\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u8eab\u4efd\u8ba4\u8bc1\u7531 OPNsense SSH \u670d\u52a1\u8d1f\u8d23<\/li>\n<li>\u7528\u6237\u6743\u9650\u7531\u7cfb\u7edf\u8d26\u6237\u51b3\u5b9a<\/li>\n<li>\u64cd\u4f5c\u65e5\u5fd7\u4ecd\u4fdd\u7559\u5728 SSH \u4f53\u7cfb\u5185<\/li>\n<li>Shell \u73af\u5883\u4e0e\u666e\u901a SSH \u767b\u5f55\u4fdd\u6301\u4e00\u81f4<\/li>\n<\/ul>\n<p class=\"p1\">\u8fd9\u610f\u5473\u7740\u4e0d\u4f1a\u5f15\u5165\u989d\u5916\u7684\u8ba4\u8bc1\u7cfb\u7edf\uff0c\u4e5f\u4e0d\u4f1a\u7ed5\u8fc7\u73b0\u6709\u5b89\u5168\u673a\u5236\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u6d4b\u8bd5\u5e73\u53f0<\/h2>\n<p style=\"text-align: justify;\">\u5728\u6700\u65b0\u7248\u7684OPNsense 26.1.9\u4e0a\u6d4b\u8bd5\u901a\u8fc7\u3002\u4e3a\u4e86\u907f\u514d\u5f71\u54cd OPNsense \u81ea\u8eab\u7684\u8f6f\u4ef6\u5305\u7cfb\u7edf\uff0cttyd \u8fd0\u884c\u65f6\u88ab\u5b89\u88c5\u5230\u72ec\u7acb\u76ee\u5f55\u3002\u5373\u4f7f\u672a\u6765 OPNsense \u5347\u7ea7\uff0c\u4e5f\u4e0d\u4f1a\u8f7b\u6613\u5f71\u54cd ttyd \u7684\u8fd0\u884c\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u5b89\u88c5\u65b9\u6cd5<\/h2>\n<pre class=\"code\">pkg add -f os-ttyd.pkg<\/pre>\n<p style=\"text-align: justify;\">\u5b8c\u6210\u540e\u5237\u65b0 OPNsense WebGUI\uff0c\u8f6c\u5230System&gt;Diagnostics &gt; ttyd \u5373\u53ef\u4f7f\u7528\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/ttyd-1.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/ttyd-1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15955\" data-original=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/ttyd-1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" width=\"2488\" height=\"2320\" \/><\/div><\/a><\/p>\n<h2 style=\"text-align: justify;\">\u5378\u8f7d\u65b9\u6cd5<\/h2>\n<pre class=\"code\">pkg delete os-ttyd<\/pre>\n<h2 style=\"text-align: justify;\">\u4f7f\u7528\u5efa\u8bae<\/h2>\n<p style=\"text-align: justify;\">\u7531\u4e8ettyd\u62e5\u6709\u5b8c\u5168\u7684shell\u6743\u9650\uff0c\u5728\u4f7f\u7528\u65f6\u9700\u8981\u7279\u522b\u5c0f\u5fc3\uff0c\u907f\u514d\u9020\u6210\u4e0d\u53ef\u9884\u6599\u7684\u540e\u679c\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u9879\u76ee\u5730\u5740<\/h2>\n<p><strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/Opnwall\/ttyd-for-OPNsense\">ttyd-for-OPNsense<\/a><\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7ba1\u7406 OPNsense \u9632\u706b\u5899\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u901a\u8fc7 SSH \u767b\u5f55\u7cfb\u7edf\u6267\u884c\u547d\u4ee4\u3001\u67e5\u770b\u65e5\u5fd7\u6216\u8005\u8fdb\u884c\u9ad8\u7ea7\u6545\u969c\u6392\u67e5\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[486],"class_list":["post-15954","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-ttyd"],"_links":{"self":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/15954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15954"}],"version-history":[{"count":6,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/15954\/revisions"}],"predecessor-version":[{"id":15963,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/15954\/revisions\/15963"}],"wp:attachment":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}