{"id":883,"date":"2020-11-14T23:13:42","date_gmt":"2020-11-14T15:13:42","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=883"},"modified":"2020-11-14T23:13:42","modified_gmt":"2020-11-14T15:13:42","slug":"%e6%a8%b1%e8%8a%b1frp-linux%e7%b3%bb%e7%bb%9f%e5%ae%89%e8%a3%85%e5%ae%98%e6%96%b9%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=883","title":{"rendered":"\u6a31\u82b1FRP Linux\u7cfb\u7edf\u5b89\u88c5\u5b98\u65b9\u8bf4\u660e"},"content":{"rendered":"\n<p><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=linux-%e7%b3%bb%e7%bb%9f%e4%bd%bf%e7%94%a8-frpc\" target=\"_blank\"  rel=\"nofollow\" >Linux \u7cfb\u7edf\u4f7f\u7528 frpc<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u6ce8\u610f\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=%e6%b3%a8%e6%84%8f\" target=\"_blank\"  rel=\"nofollow\" >\u6ce8\u610f<\/a><\/h3>\n\n\n\n<p>\u672c\u6587\u6863\u7ed9\u51fa\u7684\u547d\u4ee4\u4e2d <code>$<\/code> \u548c <code>#<\/code> \u4e0d\u9700\u8981\u8f93\u5230\u7ec8\u7aef\u91cc\uff0c\u5b83\u4eec\u53ea\u8868\u793a\u60a8\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u7684\u6743\u9650<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u73b0\u5728\u5df2\u7ecf\u6709 <code>root<\/code> \u6743\u9650\u4e86\uff0c\u53ef\u4ee5\u76f4\u63a5\u6267\u884c <code>$<\/code> \u548c <code>#<\/code> \u4e24\u79cd\u547d\u4ee4\uff0c\u53cd\u4e4b\u60a8\u53ea\u80fd\u6267\u884c <code>$<\/code> \u8fd9\u79cd\u547d\u4ee4\uff0c\u8981\u5207\u6362\u5230 <code>root<\/code> \u8d26\u6237\u624d\u80fd\u6267\u884c <code>#<\/code> \u5f00\u5934\u7684\u547d\u4ee4\uff0c\u5426\u5219\u53ef\u80fd\u51fa\u9519<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u76f4\u63a5\u4ece\u60a8\u8f93\u547d\u4ee4\u90a3\u4e2a\u5730\u65b9\u770b\u5230\u60a8\u73b0\u5728\u662f\u4e0d\u662f <code>root<\/code> \u6743\u9650:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/usage\/_images\/linux-0.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4f7f\u7528 <code>su<\/code> \u6216\u8005 <code>sudo -s<\/code> \u5373\u53ef\u5207\u6362\u5230 <code>root<\/code> \u8d26\u6237. \u5982\u679c\u63d0\u793a\u8f93\u5bc6\u7801\u8bf7\u81ea\u884c\u89e3\u51b3\uff0c\u6211\u4e0d\u53ef\u80fd\u77e5\u9053\u60a8\u7684\u7cfb\u7edf\u7684\u5bc6\u7801<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u786e\u8ba4\u7cfb\u7edf\u67b6\u6784\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=%e7%a1%ae%e8%ae%a4%e7%b3%bb%e7%bb%9f%e6%9e%b6%e6%9e%84\" target=\"_blank\"  rel=\"nofollow\" >\u786e\u8ba4\u7cfb\u7edf\u67b6\u6784<\/a><\/h3>\n\n\n\n<p>\u4e0b\u8f7d frpc \u524d\uff0c\u8bf7\u5148\u786e\u8ba4\u60a8\u7684 Linux \u7cfb\u7edf\u7684\u67b6\u6784. \u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u6839\u636e\u8f93\u51fa\u7ed3\u679c\u5c31\u53ef\u4ee5\u786e\u5b9a\u7cfb\u7edf\u67b6\u6784<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ uname -a<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u67b6\u6784<\/th><th>\u8f93\u51fa\u7ed3\u679c<\/th><\/tr><\/thead><tbody><tr><td>i386<\/td><td><code>i386<\/code>, <code>i686<\/code><\/td><\/tr><tr><td>amd64<\/td><td><code>x86_64<\/code><\/td><\/tr><tr><td>arm<\/td><td><code>arm<\/code>, <code>armv7l<\/code><\/td><\/tr><tr><td>arm64<\/td><td><code>aarch64<\/code>, <code>armv8l<\/code><\/td><\/tr><tr><td>mips<\/td><td><code>mips<\/code><\/td><\/tr><tr><td>mips64<\/td><td><code>mips64<\/code><\/td><\/tr><tr><td>\u4e0d\u652f\u6301<\/td><td><code>alpha<\/code>, <code>arc<\/code>, <code>blackfin<\/code>, <code>c6x<\/code>, <code>cris<\/code>, <code>frv<\/code>, <code>h8300<\/code>, <code>hexagon<\/code>, <code>ia64<\/code>, <code>m32r<\/code>, <code>m68k<\/code>, <code>metag<\/code>, <code>microblaze<\/code>, <code>mn10300<\/code>, <code>nios2<\/code>, <code>openrisc<\/code>, <code>parisc<\/code>, <code>parisc64<\/code>, <code>ppc<\/code>, <code>ppcle<\/code>, <code>ppc64<\/code>, <code>ppc64le<\/code>, <code>s390<\/code>, <code>s390x<\/code>, <code>score<\/code>, <code>sh<\/code>, <code>sh64<\/code>, <code>sparc<\/code>, <code>sparc64<\/code>, <code>tile<\/code>, <code>unicore32<\/code>, <code>xtensa<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5982\u679c\u60a8\u770b\u5230\u4e86\u4e0d\u5728\u4e0a\u9762\u5217\u8868\u4e2d\u7684\u8f93\u51fa\uff0c\u8bf7\u8bbf\u95ee <a href=\"https:\/\/www.baidu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >\u767e\u5ea6<\/a> \u8fdb\u884c\u641c\u7d22<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u5b89\u88c5-frpc\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=%e5%ae%89%e8%a3%85-frpc\" target=\"_blank\"  rel=\"nofollow\" >\u5b89\u88c5 frpc<\/a><\/h3>\n\n\n\n<p>\u767b\u5f55\u7ba1\u7406\u9762\u677f\uff0c\u5728\u4fa7\u8fb9\u680f\u70b9\u51fb \u201c\u8f6f\u4ef6\u4e0b\u8f7d\u201d :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/_images\/download.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u672c\u6559\u7a0b\u4e2d\u4f7f\u7528\u7684\u6f14\u793a\u5185\u6838\u4e3a x86_64 \u67b6\u6784\uff0c\u5bf9\u5e94\u6587\u4ef6\u540d\u4e3a <code>frpc_linux_arm64<\/code><br>\u5b9e\u9645\u64cd\u4f5c\u65f6\u9700\u8981\u6839\u636e\u60a8\u7684\u67b6\u6784\u6587\u4ef6\u540d\u4f1a\u6709\u6240\u4e0d\u540c\uff0c\u8bf7\u81ea\u884c\u4fee\u6539\u547d\u4ee4\u4e2d\u7684\u6587\u4ef6\u540d<\/p>\n\n\n\n<p>\u627e\u5230 frpc \u7684\u5404\u79cd\u4e0b\u8f7d\u5730\u5740\u548c\u60a8\u7684\u67b6\u6784\u6807\u5fd7\uff0c\u590d\u5236\u53f3\u8fb9\u84dd\u8272\u7684\u4e0b\u8f7d\u5730\u5740<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/usage\/_images\/linux-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u8fdb\u5165 <code>\/usr\/local\/bin<\/code> \u76ee\u5f55\u5e76\u4e0b\u8f7d\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cd \/usr\/local\/bin\n# curl -Lo frpc \u60a8\u521a\u624d\u590d\u5236\u7684\u4e0b\u8f7d\u5730\u5740<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/usage\/_images\/linux-2.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u7136\u540e\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u8bbe\u7f6e\u6b63\u786e\u7684\u6743\u9650\u5e76\u68c0\u67e5\u8f93\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># chmod 755 frpc\n# ls -ls frpc<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/usage\/_images\/linux-3.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u60a8\u770b\u5230\u548c\u56fe\u91cc\u4e00\u6837\u7684\u8f93\u51fa\uff0cfrpc \u5c31\u5b89\u88c5\u5b8c\u6210\u5e76\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u4e86\u3002\u60a8\u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u518d\u6b21\u786e\u8ba4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ frpc -v<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u4f7f\u7528-frpc\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=%e4%bd%bf%e7%94%a8-frpc\" target=\"_blank\"  rel=\"nofollow\" >\u4f7f\u7528 frpc<\/a><\/h3>\n\n\n\n<p>\u8bf7\u67e5\u770b <a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/manual?id=%e6%99%ae%e9%80%9a%e7%94%a8%e6%88%b7\" target=\"_blank\"  rel=\"nofollow\" >\u7528\u6237\u624b\u518c<\/a> \u4e2d\u7684 <strong>\u666e\u901a\u7528\u6237<\/strong> \u4e00\u8282\u5b66\u4e60 frpc \u7684\u57fa\u672c\u4f7f\u7528\u65b9\u6cd5<\/p>\n\n\n\n<p>\u901a\u8fc7\u672c\u6587\u6863\u4e2d\u4ecb\u7ecd\u7684\u65b9\u6cd5\u5b89\u88c5\u540e\uff0c\u60a8\u5e94\u8be5\u53ef\u4ee5\u5728\u4efb\u4f55\u76ee\u5f55\u76f4\u63a5\u8f93\u5165 <code>frpc &lt;\u53c2\u6570&gt;<\/code> \u8fd0\u884c frpc \uff0c<strong>\u4e0d\u9700\u8981<\/strong> \u8f93\u5165\u5b8c\u6574\u8def\u5f84<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u914d\u7f6e\u5f00\u673a\u81ea\u542f\u540e\u53f0\u8fd0\u884c\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/usage\/linux?id=%e9%85%8d%e7%bd%ae%e5%bc%80%e6%9c%ba%e8%87%aa%e5%90%af%e5%90%8e%e5%8f%b0%e8%bf%90%e8%a1%8c\" target=\"_blank\"  rel=\"nofollow\" >\u914d\u7f6e\u5f00\u673a\u81ea\u542f\/\u540e\u53f0\u8fd0\u884c<\/a><\/h3>\n\n\n\n<p>\u5982\u679c\u60a8\u60f3\u8ba9 frpc \u5728\u5f00\u673a\u65f6\u81ea\u542f\u6216\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u5c31\u9700\u8981\u5c06 frpc \u6ce8\u518c\u4e3a\u7cfb\u7edf\u670d\u52a1<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u60a8\u8981\u641e\u6e05\u695a\u60a8\u7684 Linux \u7cfb\u7edf\u4f7f\u7528\u7684 <strong><em>\u521d\u59cb\u5316\u7cfb\u7edf<\/em><\/strong> \u662f\u4ec0\u4e48\uff0c\u672c\u6587\u6863\u63d0\u4f9b\u4e09\u79cd\u5e38\u89c1\u521d\u59cb\u5316\u7cfb\u7edf\u7684\u914d\u7f6e\u6307\u5357:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Systemd<\/li><li>Upstart<\/li><li>SysV-Init<\/li><\/ul>\n\n\n\n<p>\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u7136\u540e\u67e5\u770b\u8f93\u51fa\uff0c\u627e\u5230\u60a8\u7684\u521d\u59cb\u5316\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># if &#91;&#91; `\/sbin\/init --version` =~ upstart ]]; then echo Upstart; elif &#91;&#91; `systemctl` =~ -\\.mount ]]; then echo Systemd; elif &#91;&#91; -f \/etc\/init.d\/cron &amp;&amp; ! -h \/etc\/init.d\/cron ]]; then echo SysV-Init; else echo Unknown; fi<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/usage\/_images\/linux-4.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u53c2\u8003\u4e0b\u9762\u7684\u6559\u7a0b\u914d\u7f6e\u670d\u52a1:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd\" target=\"_blank\"  rel=\"nofollow\" >Systemd \u914d\u7f6e\u6307\u5357<\/a><\/li><li>\u53e6\u5916\u4e24\u4e2a\u8fd8\u5728\u5199<\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=systemd-%e9%85%8d%e7%bd%ae-frpc-%e6%9c%8d%e5%8a%a1\" target=\"_blank\"  rel=\"nofollow\" >Systemd \u914d\u7f6e frpc \u670d\u52a1<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u524d\u7f6e\u77e5\u8bc6\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=%e5%89%8d%e7%bd%ae%e7%9f%a5%e8%af%86\" target=\"_blank\"  rel=\"nofollow\" >\u524d\u7f6e\u77e5\u8bc6<\/a><\/h3>\n\n\n\n<p>Systemd \u662f Linux \u7cfb\u7edf\u7684\u4e00\u79cd\u521d\u59cb\u5316\u7cfb\u7edf\u5b9e\u73b0\uff0c\u5b83\u7ba1\u7406\u7684\u5404\u79cd\u670d\u52a1\u53eb\u505a <strong>Unit<\/strong>\uff0c\u6bcf\u4e2a\u670d\u52a1\u5bf9\u5e94\u4e00\u4e2a <strong>Unit \u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u5728\u672c\u6559\u7a0b\u4e2d\uff0cfrpc \u4f1a\u88ab\u6ce8\u518c\u4e3a\u4e00\u4e2a\u670d\u52a1\uff0c\u6211\u4eec\u8ba9 <strong>Systemd<\/strong> \u6765\u81ea\u52a8\u7ba1\u7406 frpc\uff0c\u501f\u6b64\u5b9e\u73b0\u5f00\u673a\u81ea\u542f\u548c\u540e\u53f0\u8fd0\u884c<\/p>\n\n\n\n<p>Systemd \u7684\u670d\u52a1\u6709\u4e24\u79cd\u72b6\u6001:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>\u8fd0\u884c\u4e2d<\/code>\/<code>\u5df2\u505c\u6b62<\/code>\/<code>\u9519\u8bef<\/code><\/li><li><code>\u542f\u7528<\/code>\/<code>\u7981\u7528<\/code><\/li><\/ul>\n\n\n\n<p>\u5982\u679c <strong>\u542f\u7528<\/strong> \u4e86\u670d\u52a1\uff0c\u5f00\u673a\u7684\u65f6\u5019\u670d\u52a1\u5c31\u4f1a\u81ea\u542f\uff0c\u53cd\u4e4b\u5c31\u4e0d\u4f1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u7f16\u5199\u914d\u7f6e\u6587\u4ef6\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=%e7%bc%96%e5%86%99%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6\" target=\"_blank\"  rel=\"nofollow\" >\u7f16\u5199\u914d\u7f6e\u6587\u4ef6<\/a><\/h3>\n\n\n\n<p>Systemd \u7684 <strong>Unit \u914d\u7f6e\u6587\u4ef6<\/strong> \u901a\u5e38\u4f4d\u4e8e\u8fd9\u4e9b\u76ee\u5f55\u4e2d:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\/lib\/systemd\/system<\/li><li>\/etc\/systemd\/system<\/li><\/ul>\n\n\n\n<p>\u672c\u6559\u7a0b\u5c06\u9009\u7528\u7b2c\u4e00\u4e2a\u76ee\u5f55\u6765\u653e\u7f6e frpc \u7684 <strong>Unit \u914d\u7f6e\u6587\u4ef6<\/strong>\uff0c\u5e76\u4e14 frpc \u542f\u7528\u540e\u62a5\u9519\u9000\u51fa\u65f6\u6bcf\u5206\u949f\u4f1a\u81ea\u52a8\u91cd\u542f\u4e00\u6b21<\/p>\n\n\n\n<p>\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u60a8\u5e94\u8be5\u4f1a\u770b\u5230\u56fe\u4e2d\u7684\u63d0\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vi \/lib\/systemd\/system\/frpc@.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/service\/_images\/systemd-0.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u6309\u4e00\u4e0b <code>i<\/code> \u952e\uff0c\u5de6\u4e0b\u89d2\u5e94\u8be5\u4f1a\u51fa\u73b0 <code>-- INSERT --<\/code> \u6216\u8005 <code>-- \u63d2\u5165 --<\/code> \u5b57\u6837<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/service\/_images\/systemd-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u7136\u540e\u590d\u5236\u5e76\u7c98\u8d34\u4e0b\u9762\u63d0\u4f9b\u7684\u670d\u52a1\u6587\u4ef6\u5185\u5bb9\uff0c\u8bf7\u6ce8\u610f <strong>\u4e0d\u8981<\/strong> \u591a\u590d\u5236\u6216\u5c11\u590d\u5236\u4efb\u4f55\u4e1c\u897f\uff0c\u786e\u4fdd\u7c98\u8d34\u540e\u7684\u5185\u5bb9\u548c\u56fe\u4e2d\u4e00\u6a21\u4e00\u6837<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=SakuraFrp Service\nAfter=network.target\n\n&#91;Service]\nType=idle\nUser=nobody\nRestart=on-failure\nRestartSec=60s\nExecStart=\/usr\/local\/bin\/frpc -f %i\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>\u7c98\u8d34\u5b8c\u6210\u540e\u6309\u4e00\u4e0b <code>ESC<\/code>\uff0c\u5de6\u4e0b\u89d2\u7684 <code>-- INSERT --<\/code> \u4f1a\u6d88\u5931\uff0c\u6b64\u65f6\u8f93\u5165 <code>:wq<\/code> \u5e76\u6309\u56de\u8f66\u9000\u51fa<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/service\/_images\/systemd-2.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u91cd\u8f7d Systemd\uff0c\u8fd9\u6837\u670d\u52a1\u5c31\u914d\u7f6e\u5b8c\u6210\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>\u8bf7\u8bb0\u4f4f\u540e\u7eed\u64cd\u4f5c\u4e2d\u7528\u5230\u7684 <code>Unit \u540d\u79f0<\/code> \u662f <code>frpc@&lt;\u542f\u52a8\u53c2\u6570&gt;<\/code>\uff0c\u4f8b\u5982 <code>frpc@wdnmdtoken666666:12345<\/code><\/p>\n\n\n\n<p>\u4e0b\u9762\u672c\u6559\u7a0b\u5c06\u4ecb\u7ecd\u4e00\u4e9b Systemd \u7684\u57fa\u672c\u64cd\u4f5c<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u542f\u52a8\u505c\u6b62\u96a7\u9053\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=%e5%90%af%e5%8a%a8%e5%81%9c%e6%ad%a2%e9%9a%a7%e9%81%93\" target=\"_blank\"  rel=\"nofollow\" >\u542f\u52a8\/\u505c\u6b62\u96a7\u9053<\/a><\/h3>\n\n\n\n<p>\u542f\u52a8\/\u505c\u6b62\u96a7\u9053\u975e\u5e38\u7b80\u5355\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u5373\u53ef\uff0c<code>start<\/code> \u662f\u542f\u52a8\uff0c<code>stop<\/code> \u662f\u505c\u6b62<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl &lt;start|stop> &lt;Unit\u540d\u79f0><\/code><\/pre>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl start frpc@wdnmdtoken666666:12345<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u67e5\u770b\u96a7\u9053\u72b6\u6001\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=%e6%9f%a5%e7%9c%8b%e9%9a%a7%e9%81%93%e7%8a%b6%e6%80%81\" target=\"_blank\"  rel=\"nofollow\" >\u67e5\u770b\u96a7\u9053\u72b6\u6001<\/a><\/h3>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b\u670d\u52a1\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl status &lt;Unit\u540d\u79f0><\/code><\/pre>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u8981\u67e5\u770b\u4e0a\u9762\u5f00\u542f\u7684\u96a7\u9053\u72b6\u6001\u53ef\u4ee5\u4f7f\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl status frpc@wdnmdtoken666666:12345<\/code><\/pre>\n\n\n\n<p><strong>\u7edd\u5bf9\u4e0d\u8981<\/strong> \u5f00\u542f\u91cd\u590d\u7684\u96a7\u9053\uff0c\u8fd9\u4f1a\u9020\u6210\u51fa\u73b0\u5404\u79cd\u4e0d\u53ef\u9884\u8ba1\u7684 Bug<br>\u6267\u884c\u591a\u6b21 <code>systemctl start<\/code> \u662f <strong>\u5b89\u5168<\/strong> \u7684<br>\u914d\u7f6e\u597d Systemd \u540e\uff0c<strong>\u4e0d\u8981<\/strong> \u518d\u7528 <code>frpc -f &lt;\u542f\u52a8\u53c2\u6570&gt;<\/code> \u7684\u5f62\u5f0f\u5f00\u542f\u96a7\u9053<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u5fd8\u8bb0\u4e86\u4e4b\u524d\u5f00\u542f\u8fc7\u54ea\u4e9b\u96a7\u9053\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u53ef\u4ee5\u5217\u51fa\u5f53\u524d\u8fd0\u884c\u4e2d\u7684\u96a7\u9053<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl list-units frpc@*<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/service\/_images\/systemd-3.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u914d\u7f6e\u5f00\u673a\u81ea\u542f\"><a href=\"https:\/\/doc.natfrp.com\/#\/frpc\/service\/systemd?id=%e9%85%8d%e7%bd%ae%e5%bc%80%e6%9c%ba%e8%87%aa%e5%90%af\" target=\"_blank\"  rel=\"nofollow\" >\u914d\u7f6e\u5f00\u673a\u81ea\u542f<\/a><\/h3>\n\n\n\n<p>\u88c5\u597d\u670d\u52a1\u540e\uff0c\u5b9e\u73b0\u5f00\u673a\u81ea\u542f\u975e\u5e38\u7b80\u5355\uff0c\u56de\u987e\u4e00\u4e0b\u524d\u7f6e\u77e5\u8bc6<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6211\u4eec\u53ea\u8981 <code>\u542f\u7528<\/code> \u670d\u52a1\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5f00\u673a\u81ea\u542f<\/li><li>\u5982\u679c\u4e0d\u60f3\u5f00\u673a\u81ea\u542f\u4e86\uff0c<code>\u7981\u7528<\/code> \u670d\u52a1\u5373\u53ef<\/li><\/ul>\n\n\n\n<p>\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u542f\u7528\/\u7981\u7528\u670d\u52a1\uff0c<code>enable<\/code> \u662f\u542f\u7528\uff0c<code>disable<\/code> \u662f\u7981\u7528\uff0c\u64cd\u4f5c\u5b8c\u6210\u540e\u518d\u7528 <code>status<\/code> \u68c0\u67e5\u4e00\u4e0b\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl &lt;enable|disable> &lt;Unit\u540d\u79f0>\n# systemctl status &lt;Unit\u540d\u79f0><\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u4f1a\u770b\u5230\u6211\u56fe\u4e2d\u7684\u4e24\u4e2a\u7ea2\u8272\u6807\u6ce8\u7684\u5185\u5bb9<\/p>\n\n\n\n<p>\u6ca1\u770b\u5230\u7b2c\u4e00\u4e2a\u521b\u5efa\u7b26\u53f7\u94fe\u63a5\u7684\u63d0\u793a\u4e5f\u662f\u6b63\u5e38\u7684\uff0c\u53ea\u8981\u4e0b\u9762\u7684\u72b6\u6001\u663e\u793a\u4e3a <code>enabled<\/code> \u5c31\u884c<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/doc.natfrp.com\/frpc\/service\/_images\/systemd-4.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u60a8\u5fd8\u8bb0\u4e86\u4e4b\u524d\u8bbe\u7f6e\u8fc7\u7684\u81ea\u542f\u96a7\u9053\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u5217\u51fa<\/p>\n\n\n\n<p>\u548c\u4e0a\u9762\u662f\u7c7b\u4f3c\u7684\uff0c\u53ea\u662f\u591a\u4e86\u4e2a <code>--all<\/code> \u786e\u4fdd\u505c\u6b62\u4e86\u7684\u670d\u52a1\u4e5f\u80fd\u88ab\u5217\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># systemctl list-units --all frpc@*<\/code><\/pre>\n\n\n\n<p><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"883\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>Linux \u7cfb\u7edf\u4f7f\u7528 frpc \u6ce8\u610f \u672c\u6587\u6863\u7ed9\u51fa\u7684\u547d\u4ee4\u4e2d $ \u548c # \u4e0d\u9700\u8981\u8f93\u5230\u7ec8\u7aef\u91cc\uff0c\u5b83\u4eec\u53ea\u8868\u793a\u60a8\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u7684\u6743\u9650 \u5982\u679c\u60a8 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-883","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=883"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/883\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}