{"id":277,"date":"2025-06-13T07:50:57","date_gmt":"2025-06-12T23:50:57","guid":{"rendered":"https:\/\/qkd.koudaipc.com\/?p=277"},"modified":"2026-01-27T21:21:41","modified_gmt":"2026-01-27T13:21:41","slug":"%e5%9c%a8-kpcos-%e7%82%8e%e5%b8%9d-1-01-%e4%b8%8a%e5%bc%80%e5%90%af-rdp-%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/qkd.koudaipc.com\/en\/2025\/06\/13\/%e5%9c%a8-kpcos-%e7%82%8e%e5%b8%9d-1-01-%e4%b8%8a%e5%bc%80%e5%90%af-rdp-%e6%9c%8d%e5%8a%a1\/","title":{"rendered":"\u5728 KPCOS\/\u708e\u5e1d 1.01 \u4e0a\u5f00\u542f RDP \u670d\u52a1"},"content":{"rendered":"<p>\u5728 KPCOS\/\u708e\u5e1d 1.01 \u4e0a\u914d\u7f6e xrdp \u670d\u52a1\u5e76\u4f7f\u7528\u8f7b\u91cf\u7ea7 XFCE \u684c\u9762\u7684\u5b8c\u6574\u6307\u5357\uff1a<\/p>\n<hr \/>\n<h3>1. <strong>\u5b89\u88c5 XFCE \u684c\u9762\u548c\u5fc5\u8981\u7ec4\u4ef6<\/strong><\/h3>\n<pre><code class=\"language-bash\"># \u66f4\u65b0\u7cfb\u7edf\nsudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y\n\n# \u5b89\u88c5 XFCE \u6838\u5fc3\u684c\u9762\uff08\u8f7b\u91cf\u7ea7\uff09\nsudo apt install xfce4 xfce4-goodies -y\n\n# \u5b89\u88c5\u8fdc\u7a0b\u684c\u9762\u670d\u52a1\nsudo apt install xrdp xorgxrdp -y\n\n# \u5b89\u88c5\u4e2d\u6587\u652f\u6301\uff08\u53ef\u9009\uff09\nsudo apt install xfce4-l10n-zh-cn fonts-noto-cjk -y<\/code><\/pre>\n<hr \/>\n<h3>2. <strong>\u914d\u7f6e xrdp \u4f7f\u7528 XFCE<\/strong><\/h3>\n<h4>\u7f16\u8f91\u542f\u52a8\u811a\u672c\uff1a<\/h4>\n<pre><code class=\"language-bash\">sudo nano \/etc\/xrdp\/startwm.sh<\/code><\/pre>\n<h4><strong>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0<\/strong>\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u5728\u6700\u540e\u4e00\u884c exit 0 \u4e4b\u524d\u6dfb\u52a0\uff1a\nunset DBUS_SESSION_BUS_ADDRESS\nunset XDG_RUNTIME_DIR\n. \/etc\/X11\/Xsession\n\n# \u542f\u52a8 XFCE\nstartxfce4<\/code><\/pre>\n<h4>\u5b8c\u6574\u6587\u4ef6\u7ed3\u5c3e\u793a\u4f8b\uff1a<\/h4>\n<pre><code class=\"language-bash\">...\n# \u539f\u6587\u4ef6\u5185\u5bb9\u4fdd\u7559\n\n# \u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a\nif [ -r \/etc\/default\/locale ]; then\n  . \/etc\/default\/locale\n  export LANG LANGUAGE\nfi\n\nstartxfce4\n\nexit 0<\/code><\/pre>\n<hr \/>\n<h3>3. <strong>\u8bbe\u7f6e\u7528\u6237\u684c\u9762\u73af\u5883<\/strong><\/h3>\n<h4>\u4e3a\u6240\u6709\u7528\u6237\u8bbe\u7f6e\u9ed8\u8ba4 XFCE\uff1a<\/h4>\n<pre><code class=\"language-bash\">echo &amp;quot;startxfce4&amp;quot; | sudo tee \/etc\/xrdp\/startwm.sh<\/code><\/pre>\n<h4>\u4e3a\u5f53\u524d\u7528\u6237\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\uff1a<\/h4>\n<pre><code class=\"language-bash\">echo &amp;quot;xfce4-session&amp;quot; &amp;gt; ~\/.xsession\nchmod +x ~\/.xsession<\/code><\/pre>\n<hr \/>\n<h3>4. <strong>\u4f18\u5316 XFCE \u8fdc\u7a0b\u4f53\u9a8c<\/strong><\/h3>\n<pre><code class=\"language-bash\"># \u7981\u7528\u5c4f\u5e55\u4fdd\u62a4\u548c\u7535\u6e90\u7ba1\u7406\nxfconf-query -c xfce4-session -p \/shutdown\/LockScreen -s false\nxfconf-query -c xfce4-power-manager -p \/xfce4-power-manager\/lock-screen-suspend-hibernate -s false\nxfconf-query -c xfce4-power-manager -p \/xfce4-power-manager\/blank-on-ac -s 0\n\n# \u7981\u7528\u5408\u6210\u5668\uff08\u907f\u514d\u9ed1\u5c4f\uff09\nxfconf-query -c xfwm4 -p \/general\/use_compositing -s false<\/code><\/pre>\n<hr \/>\n<h3>5. <strong>\u542f\u52a8\u5e76\u914d\u7f6e xrdp<\/strong><\/h3>\n<pre><code class=\"language-bash\"># \u542f\u7528\u670d\u52a1\nsudo systemctl enable xrdp --now\n\n# \u9632\u706b\u5899\u653e\u884c RDP \u7aef\u53e3\uff083389\uff09\nsudo ufw allow 3389\n\n# \u67e5\u770b\u670d\u52a1\u72b6\u6001\nsudo systemctl status xrdp<\/code><\/pre>\n<hr \/>\n<h3>6. <strong>\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/strong><\/h3>\n<h4><strong>\u4fee\u590d\u8fde\u63a5\u9ed1\u5c4f<\/strong>\uff1a<\/h4>\n<p>\u7f16\u8f91 Polkit \u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo nano \/etc\/polkit-1\/localauthority.conf.d\/02-allow-colord.conf<\/code><\/pre>\n<p>\u6dfb\u52a0\uff1a<\/p>\n<pre><code class=\"language-conf\">polkit.addRule(function(action, subject) {\n  if ((action.id == &amp;quot;org.freedesktop.color-manager.create-device&amp;quot; ||\n       action.id == &amp;quot;org.freedesktop.color-manager.create-profile&amp;quot; ||\n       action.id == &amp;quot;org.freedesktop.color-manager.delete-device&amp;quot; ||\n       action.id == &amp;quot;org.freedesktop.color-manager.delete-profile&amp;quot; ||\n       action.id == &amp;quot;org.freedesktop.color-manager.modify-device&amp;quot; ||\n       action.id == &amp;quot;org.freedesktop.color-manager.modify-profile&amp;quot;) &amp;amp;&amp;amp;\n      subject.isInGroup(&amp;quot;{users}&amp;quot;)) {\n    return polkit.Result.YES;\n  }\n});<\/code><\/pre>\n<h4><strong>\u4fee\u590d\u97f3\u9891\u95ee\u9898<\/strong>\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u5b89\u88c5\u97f3\u9891\u652f\u6301\nsudo apt install xrdp-pulseaudio-installer -y\n\n# \u94fe\u63a5\u97f3\u9891\u6a21\u5757\nsudo ln -s \/usr\/lib\/pulse-16.0\/modules\/module-xrdp-sink.so \/usr\/lib\/pulse-16.0\/modules\/\nsudo ln -s \/usr\/lib\/pulse-16.0\/modules\/module-xrdp-source.so \/usr\/lib\/pulse-16.0\/modules\/<\/code><\/pre>\n<hr \/>\n<h3>7. <strong>\u5ba2\u6237\u7aef\u8fde\u63a5\u65b9\u6cd5<\/strong><\/h3>\n<h4>Windows\uff1a<\/h4>\n<ol>\n<li>\u6309 &lt;code&gt;Win + R&lt;\/code&gt; \u8f93\u5165 &lt;code&gt;mstsc&lt;\/code&gt;<\/li>\n<li>\u8f93\u5165 Debian \u670d\u52a1\u5668\u7684 IP \u5730\u5740<\/li>\n<li>\u767b\u5f55\u51ed\u636e\uff1a\u7cfb\u7edf\u7528\u6237\u540d\/\u5bc6\u7801<\/li>\n<li>\u9009\u62e9\u4f1a\u8bdd\u7c7b\u578b\uff1a<strong>Xorg<\/strong><\/li>\n<\/ol>\n<h4>Linux\/macOS\uff1a<\/h4>\n<ul>\n<li>\u4f7f\u7528 Remmina\uff1a\n<pre><code class=\"language-bash\">sudo apt install remmina remmina-plugin-rdp<\/code><\/pre>\n<\/li>\n<li>\u6216\u4f7f\u7528 FreeRDP\uff1a\n<pre><code class=\"language-bash\">xfreerdp \/v:\u670d\u52a1\u5668IP \/u:\u7528\u6237\u540d \/p:\u5bc6\u7801 +clipboard \/dynamic-resolution<\/code><\/pre>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>8. <strong>\u81ea\u5b9a\u4e49 XFCE \u5e03\u5c40<\/strong><\/h3>\n<h4>\u521b\u5efa\u9ed8\u8ba4\u5e03\u5c40\u6a21\u677f\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u767b\u5f55\u540e\u914d\u7f6e\u597d\u7406\u60f3\u5e03\u5c40\ncp -r ~\/.config\/xfce4 ~\/.config\/xfce4-default\n\n# \u8bbe\u7f6e\u4e3a\u65b0\u7528\u6237\u9ed8\u8ba4\u914d\u7f6e\nsudo cp -r ~\/.config\/xfce4-default \/etc\/skel\/.config\/xfce4<\/code><\/pre>\n<h4>\u4f18\u5316\u8fdc\u7a0b\u6027\u80fd\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u7981\u7528\u7279\u6548\nxfconf-query -c xfwm4 -p \/general\/use_compositing -s false\n\n# \u51cf\u5c11\u52a8\u753b\nxfconf-query -c xsettings -p \/Net\/EnableEventSounds -s false\nxfconf-query -c xsettings -p \/Net\/EnableInputFeedbackSounds -s false<\/code><\/pre>\n<hr \/>\n<h3>9. <strong>\u591a\u7528\u6237\u914d\u7f6e<\/strong><\/h3>\n<pre><code class=\"language-bash\"># \u521b\u5efa\u65b0\u7528\u6237\nsudo adduser username\n\n# \u8bbe\u7f6e\u7528\u6237\u9ed8\u8ba4\u684c\u9762\nsudo mkdir \/home\/username\/.config\nsudo cp -r \/etc\/skel\/.config\/xfce4 \/home\/username\/.config\/\nsudo chown -R username:username \/home\/username<\/code><\/pre>\n<hr \/>\n<h3>10. <strong>\u9ad8\u7ea7\u5b89\u5168\u914d\u7f6e<\/strong><\/h3>\n<h4>\u66f4\u6539\u9ed8\u8ba4\u7aef\u53e3\uff1a<\/h4>\n<pre><code class=\"language-bash\">sudo nano \/etc\/xrdp\/xrdp.ini<\/code><\/pre>\n<p>\u4fee\u6539\uff1a<\/p>\n<pre><code class=\"language-ini\">port=3390  # \u6216\u5176\u4ed6\u975e\u6807\u51c6\u7aef\u53e3<\/code><\/pre>\n<h4>\u542f\u7528 SSL \u52a0\u5bc6\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u751f\u6210\u8bc1\u4e66\nsudo openssl req -x509 -newkey rsa:4096 -nodes -keyout \/etc\/xrdp\/key.pem -out \/etc\/xrdp\/cert.pem -days 365\n\n# \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\nsudo nano \/etc\/xrdp\/xrdp.ini<\/code><\/pre>\n<p>\u6dfb\u52a0\uff1a<\/p>\n<pre><code class=\"language-ini\">[globals]\nsecurity_layer=tls\ncertificate=\/etc\/xrdp\/cert.pem\nkey_file=\/etc\/xrdp\/key.pem<\/code><\/pre>\n<h4>\u91cd\u542f\u670d\u52a1\uff1a<\/h4>\n<pre><code class=\"language-bash\">sudo systemctl restart xrdp<\/code><\/pre>\n<hr \/>\n<h3>11. <strong>\u6545\u969c\u6392\u67e5\u547d\u4ee4<\/strong><\/h3>\n<pre><code class=\"language-bash\"># \u67e5\u770b\u5b9e\u65f6\u65e5\u5fd7\ntail -f \/var\/log\/xrdp.log\n\n# \u68c0\u67e5\u4f1a\u8bdd\u72b6\u6001\nsudo \/usr\/lib\/xrdp\/xrdp-sesman -n\n\n# \u6d4b\u8bd5 XFCE \u672c\u5730\u542f\u52a8\nstartxfce4\n\n# \u91cd\u7f6e\u7528\u6237\u914d\u7f6e\nrm -rf ~\/.cache\/sessions ~\/.config\/xfce4\/session<\/code><\/pre>\n<blockquote>\n<p><strong>\u63d0\u793a<\/strong>\uff1a\u5982\u679c\u9047\u5230\u8fde\u63a5\u95ee\u9898\uff0c\u5c1d\u8bd5\u5728\u5ba2\u6237\u7aef\u8bbe\u7f6e\u4e2d\u542f\u7528 <strong>&quot;Negotiate&quot; \u5b89\u5168\u5c42<\/strong> \u5e76\u5173\u95ed <strong>&quot;Use shell startup&quot;<\/strong><\/p>\n<\/blockquote>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u5728 KPCOS\/\u708e\u5e1d 1.01 \u4e0a\u83b7\u5f97\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u54cd\u5e94\u8fc5\u901f\u7684\u8fdc\u7a0b\u684c\u9762\u4f53\u9a8c\uff0c\u7279\u522b\u9002\u5408\u4f4e\u5e26\u5bbd\u6216\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u3002XFCE \u7684\u6a21\u5757\u5316\u8bbe\u8ba1\u4e5f\u5141\u8bb8\u60a8\u6839\u636e\u9700\u6c42\u81ea\u5b9a\u4e49\u754c\u9762\u5e03\u5c40\u548c\u529f\u80fd\u7ec4\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 KPCOS\/\u708e\u5e1d 1.01 \u4e0a\u914d\u7f6e xrdp \u670d\u52a1\u5e76\u4f7f\u7528\u8f7b\u91cf\u7ea7 XFCE \u684c\u9762\u7684\u5b8c\u6574\u6307\u5357\uff1a 1. \u5b89\u88c5 X [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","footnotes":""},"categories":[23],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-kpcos","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":2,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":420,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/277\/revisions\/420"}],"wp:attachment":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}