{"id":2216,"date":"2023-05-25T16:01:27","date_gmt":"2023-05-25T08:01:27","guid":{"rendered":"https:\/\/blog.kingsbestone.com\/?p=2216"},"modified":"2023-05-25T16:01:27","modified_gmt":"2023-05-25T08:01:27","slug":"centos7-9%e5%ae%89%e8%a3%85syncthing","status":"publish","type":"post","link":"https:\/\/blog.kingsbestone.com\/?p=2216","title":{"rendered":"Centos7.9\u5b89\u88c5Syncthing"},"content":{"rendered":"<p><span style=\"font-family: 'comic sans ms', sans-serif;\">Syncthing\u662f\u4e00\u4e2a\u5f00\u6e90\u514d\u8d39\u7684\u540c\u6b65\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5e2e\u5fd9\u5355\u5411\u540c\u6b65\u6216\u8005\u53cc\u5411\u540c\u6b65\u6570\u636e\u3002Syncthing\u662f\u7528Go\u8bed\u8a00\u6240\u7f16\u5199\u7684\u6240\u4ee5\u5177\u5907\u8de8\u5e73\u53f0\u7684\u5c5e\u6027\uff0cWindows\u6216Linux\u90fd\u53ef\u4ee5\u4f7f\u7528\u3002<\/span><\/p>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">1.\u5b89\u88c5\u81ea\u52a8\u8865\u9f50\u547d\u4ee4\u811a\u672c<\/span><\/h1>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">yum -y install bash-completion<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">TIPS\uff1a\u5b89\u88c5\u5b8c\u6210\u540e\u9700\u8981\u65ad\u5f00\u91cd\u65b0\u8fde\u63a5SSH<\/span><\/p>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">2.\u5173\u95ed\u9632\u706b\u5899<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-1.\u67e5\u770b\u7cfb\u7edf\u9632\u706b\u5899\u8fd0\u884c\u72b6\u6001<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status firewalld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-2.\u5173\u95ed\u9632\u706b\u5899\u548c\u7981\u6b62\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl stop firewalld.service &amp;&amp; systemctl disable firewalld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-3.\u67e5\u770b\u7cfb\u7edf\u9632\u706b\u5899\u8fd0\u884c\u72b6\u6001\uff08\u786e\u8ba4\u662f\u5426\u5df2\u5173\u95ed\uff09<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status firewalld.service<\/pre>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">3.\u4e0b\u8f7dSyncthing\u5e76\u89e3\u538b<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-1.\u4e0b\u8f7dSyncthing\u5b98\u7f51\uff1a<a href=\"https:\/\/syncthing.net\/downloads\/\" target=\"_blank\" rel=\"noopener\">https:\/\/syncthing.net\/downloads\/<\/a><\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-2.\u4e0b\u8f7d\u5b8c\u6210\u540e\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u4e0a<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-3.\u89e3\u538b\u4e0b\u8f7d\u7684\u538b\u7f29\u5305<\/span><\/p>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">4.\u590d\u5236\u5230\u5de5\u4f5c\u76ee\u5f55<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-1.\u590d\u5236\u4e3b\u7a0b\u5e8f\u5230\u5de5\u4f5c\u76ee\u5f55<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp \/root\/syncthing\/syncthing \/usr\/bin\/<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-2.\u590d\u5236systemd\u914d\u7f6e\u6587\u4ef6\u5230\u5de5\u4f5c\u76ee\u5f55<\/span><\/p>\n<ul>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">centos7\u4f7f\u7528syncthing\u4e2d\u7684etc\/linux-systemd\/\u6587\u4ef6\u3002<\/span><\/li>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">\u5148\u5207\u6362\u5230syncthing\u538b\u7f29\u5305\u4e2d\u7684linux-systemd\u5de5\u4f5c\u76ee\u5f55\u4e0b<\/span><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp -r system\/* \/etc\/systemd\/system\/\r\ncp -r user\/* \/etc\/systemd\/user\/<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-3.\u4fee\u6539\u6587\u4ef6\u540d\u79f0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/etc\/systemd\/system\r\nmv syncthing@.service syncthing@root.service<\/pre>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">5.\u4fee\u6539\u914d\u6587\u4ef6<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-1.\u9996\u6b21\u8fd0\u884c\u4e00\u6b21\uff0c\u8ba9\u7a0b\u5e8f\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl start syncthing@root.service &amp;&amp; systemctl status syncthing@root.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-2.\u505c\u6b62\u8fd0\u884c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl stop syncthing@root.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-3.\u4fee\u6539\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<ul>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">\u9ed8\u8ba4\u7b56\u7565\u53ea\u5141\u8bb8127.0.0.1:8384\u8bbf\u95ee\uff0c\u9700\u8981\u4fee\u6539\u4e3a\uff1a0.0.0.0:8384\uff08\u5168\u90e8\u5141\u8bb8\u8bbf\u95ee\uff09<\/span><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/root\/.config\/syncthing\/config.xml<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-4.\u641c\u7d22\u5173\u952e\u8bcd\uff1a127.0.0.1:8384\u5e76\u4fee\u6539\u4e3a0.0.0.0:8384<\/span><\/p>\n<ul>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">\/127.0.0.1:8384\uff08VI\u6a21\u5f0f\uff09<\/span><\/li>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">\u6309\u4e0bN\u6309\u952e\uff0c\u7ee7\u7eed\u67e5\u8be2\u4e0b\u4e00\u4e2a\u3002<\/span><\/li>\n<\/ul>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">6.\u5f00\u542f\u670d\u52a1<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-1.\u8fd0\u884c\u5e76\u6dfb\u52a0\u5f00\u673a\u81ea\u542f\u52a8\u670d\u52a1<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl start syncthing@root.service &amp;&amp; systemctl enable syncthing@root.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-2.\u67e5\u770b\u8fd0\u884c\u72b6\u6001<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status syncthing@root.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-3.\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u7f51\u9875\uff1aIP:8384<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-4.\u901a\u8fc7\u7f51\u9875\u7ed9\u7ed9syncthing\u8bbe\u5b9a\u8bbf\u95ee\u8d26\u6237\u548c\u5bc6\u7801<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-5.\u5ffd\u7565\u4ee5root\u7528\u6237\u8fd0\u884c\u7684\u63d0\u793a\uff0c\u6211TMD\u5c31\u8981\u7528ROOT\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Syncthing\u662f\u4e00\u4e2a\u5f00\u6e90\u514d\u8d39\u7684\u540c\u6b65\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5e2e\u5fd9\u5355\u5411\u540c\u6b65\u6216\u8005\u53cc\u5411\u540c\u6b65\u6570\u636e\u3002Syncthing\u662f\u7528Go\u8bed\u8a00\u6240\u7f16\u5199\u7684\u6240\u4ee5\u5177\u5907\u8de8\u5e73\u53f0\u7684\u5c5e\u6027\uff0cWindows\u6216Linux\u90fd\u53ef\u4ee5\u4f7f\u7528\u3002 1.\u5b89\u88c5\u81ea\u52a8\u8865\u9f50\u547d\u4ee4\u811a\u672c yum -y install bash-completion TIPS\uff1a\u5b89\u88c5\u5b8c\u6210\u540e\u9700\u8981\u65ad\u5f00\u91cd\u65b0\u8fde\u63a5SSH 2.\u5173\u95ed\u9632 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Centos7.9\u5b89\u88c5Syncthing\" class=\"read-more button\" href=\"https:\/\/blog.kingsbestone.com\/?p=2216#more-2216\" aria-label=\"\u66f4\u591a Centos7.9\u5b89\u88c5Syncthing\">\u67e5\u770b\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":212,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[59,4],"tags":[18,76],"_links":{"self":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2216"}],"collection":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2216"}],"version-history":[{"count":11,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2216\/revisions"}],"predecessor-version":[{"id":2227,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2216\/revisions\/2227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/media\/212"}],"wp:attachment":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}