{"id":779,"date":"2020-12-21T04:23:30","date_gmt":"2020-12-20T20:23:30","guid":{"rendered":"https:\/\/byy3.com\/?p=779"},"modified":"2021-02-08T19:00:54","modified_gmt":"2021-02-08T11:00:54","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu-20-04-%e4%b8%8a%e5%ae%89%e8%a3%85-xrdp-%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bf%9c%e7%a8%8b%e6%a1%8c%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=779","title":{"rendered":"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762"},"content":{"rendered":"<p><img decoding=\"async\" data-original=\"https:\/\/yqfile.alicdn.com\/0bde1f5f57e3563b1ca1ecb3a58c91d4e9dde170.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" data-spm-anchor-id=\"a2c4e.11153940.0.i8.5adc6dd8WnLHAs\" title=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe\" \/><\/p>\n<p>Xrdp \u662f\u4e00\u4e2a\u5fae\u8f6f\u8fdc\u7a0b\u684c\u9762\u534f\u8bae\uff08RDP\uff09\u7684\u5f00\u6e90\u5b9e\u73b0\uff0c\u5b83\u5141\u8bb8\u4f60\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u63a7\u5236\u8fdc\u7a0b\u7cfb\u7edf\u3002\u901a\u8fc7 RDP\uff0c\u4f60\u53ef\u4ee5\u767b\u5f55\u8fdc\u7a0b\u673a\u5668\uff0c\u5e76\u4e14\u521b\u5efa\u4e00\u4e2a\u771f\u5b9e\u7684\u684c\u9762\u4f1a\u8bdd\uff0c\u5c31\u50cf\u4f60\u767b\u5f55\u672c\u5730\u673a\u5668\u4e00\u6837\u3002<\/p>\n<p>\u8fd9\u7bc7\u6307\u5357\u8bb2\u89e3\u5982\u4f55\u5728 Ubuntu 20.04 \u4e0a\u5b89\u88c5\u548c\u914d\u7f6e Xrdp \u670d\u52a1\u5668\u3002<\/p>\n<h2 id=\"1\">\u4e00\u3001\u5b89\u88c5\u684c\u9762\u73af\u5883<\/h2>\n<p>Ubuntu \u670d\u52a1\u5668\u901a\u5e38\u4f7f\u7528\u547d\u4ee4\u884c\u8fdb\u884c\u7ba1\u7406\uff0c\u5e76\u4e14\u9ed8\u8ba4\u6ca1\u6709\u5b89\u88c5\u684c\u9762\u73af\u5883\u3002\u5982\u679c\u4f60\u6b63\u5728\u8fd0\u884c Ubuntu \u684c\u9762\u7248\uff0c\u5ffd\u7565\u8fd9\u4e00\u6b65\u3002<\/p>\n<p>\u5728 Ubuntu \u6e90\u4ed3\u5e93\u6709\u5f88\u591a\u684c\u9762\u73af\u5883\u4f9b\u4f60\u9009\u62e9\u3002\u4e00\u4e2a\u9009\u62e9\u662f\u5b89\u88c5 Gnome\uff0c\u5b83\u662f Ubuntu 20.04 \u7684\u9ed8\u8ba4\u684c\u9762\u73af\u5883\u3002\u53e6\u5916\u4e00\u4e2a\u9009\u9879\u5c31\u662f\u5b89\u88c5 xfce\u3002\u5b83\u662f\u5feb\u901f\uff0c\u7a33\u5b9a\uff0c\u5e76\u4e14\u8f7b\u91cf\u7684\u684c\u9762\u73af\u5883\uff0c\u4f7f\u5f97\u5b83\u6210\u4e3a\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u7406\u60f3\u684c\u9762\u3002<\/p>\n<p>\u8fd0\u884c\u4e0b\u9762\u4efb\u4f55\u4e00\u4e2a\u547d\u4ee4\u53bb\u5b89\u88c5\u4f60\u9009\u62e9\u7684\u684c\u9762\u73af\u5883\uff1a<\/p>\n<ul>\n<li>\u5b89\u88c5 Gnome<\/li>\n<\/ul>\n<pre data-spm-anchor-id=\"a2c4e.11153940.0.i2.5adc6dd8WnLHAs\"><code class=\"bash hljs\" data-spm-anchor-id=\"a2c4e.11153940.0.i3.5adc6dd8WnLHAs\">sudo apt update\nsudo apt install ubuntu-desktop<\/code><\/pre>\n<ul>\n<li>\u5b89\u88c5 Xfce\uff08\u63a8\u8350\uff09<\/li>\n<\/ul>\n<pre><code class=\"bash hljs\">sudo apt update\nsudo apt install xubuntu-desktop\n<em><strong> \u5982\u679c\u662fdebian\u7cfb\u7edf\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\n<\/strong><\/em><\/code><\/pre>\n<pre class=\"prettyprint-override\"><code>sudo apt update<\/code><code>sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils<\/code><\/pre>\n<pre><code class=\"bash hljs\"><\/code><\/pre>\n<p>\u53d6\u51b3\u4e8e\u4f60\u7684\u7cfb\u7edf\uff0c\u4e0b\u8f7d\u548c\u5b89\u88c5 GUI \u8f6f\u4ef6\u5305\uff0c\u5c06\u4f1a\u82b1\u8d39\u4e00\u4e9b\u65f6\u95f4\u3002<\/p>\n<h2 id=\"2\">\u4e8c\u3001\u5b89\u88c5 Xrdp<\/h2>\n<p>Xrdp \u88ab\u5305\u542b\u5728\u9ed8\u8ba4\u7684 Ubuntu \u8f6f\u4ef6\u6e90\u4e2d\u3002\u60f3\u8981\u5b89\u88c5\u5b83\uff0c\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo apt install xrdp <\/code><\/pre>\n<p>\u4e00\u65e6\u5b89\u88c5\u5b8c\u6210\uff0cXrdp \u670d\u52a1\u5c06\u4f1a\u81ea\u52a8\u542f\u52a8\u3002\u4f60\u53ef\u4ee5\u8f93\u5165\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u9a8c\u8bc1\u5b83\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo systemctl status xrdp<\/code> \u67e5\u770b\u6709\u6ca1\u6709\u9519\u8bef \u53d1\u73b0\u9519\u8bef\u5e94\u8be5\u662fkey\u9519\u8bef\u6240\u4ee5\u770b\u4e0b\u9762\u64cd\u4f5c\u6dfb\u52a0ssl <strong>\u7136\u540e\u6dfb\u52a0\u7cfb\u7edf\u81ea\u542f\u52a8 systemctl en<\/strong><\/pre>\n<p>\u8f93\u51fa\u5c06\u4f1a\u50cf\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<pre><code class=\"bash hljs\">\u25cf xrdp.service - xrdp daemon\n Loaded: loaded (\/lib\/systemd\/system\/xrdp.service; enabled; vendor preset: enabled)\n Active: active (running) since Fri 2020-05-22 17:36:16 UTC; 4min 41s ago\n ...<\/code><\/pre>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cXrdp \u4f7f\u7528<code>\/etc\/ssl\/private\/ssl-cert-snakeoil.key<\/code>,\u5b83\u4ec5\u4ec5\u5bf9\u201cssl-cert\u201d \u7528\u6237\u7ec4\u6210\u8bed\u53ef\u8bfb\u3002\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u5c06<code>xrdp<\/code>\u7528\u6237\u6dfb\u52a0\u5230\u8fd9\u4e2a\u7528\u6237\u7ec4\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo adduser xrdp ssl-cert <\/code><\/pre>\n<p>\u91cd\u542f Xrdp \u670d\u52a1\uff0c\u4f7f\u5f97\u4fee\u6539\u751f\u6548\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo systemctl restart xrdp<\/code><\/pre>\n<p>\u5c31\u8fd9\u6837\u3002Xrdp \u5df2\u7ecf\u5728\u4f60\u7684 Ubuntu \u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u597d\u4e86\uff0c\u4f60\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528\u5b83\u4e86\u3002<\/p>\n<h2 id=\"3\">\u4e09\u3001Xrdp \u914d\u7f6e<\/h2>\n<p>Xrdp \u914d\u7f6e\u6587\u4ef6\u5b9a\u4f4d\u5728<code>\/etc\/xrdp<\/code>\u76ee\u5f55\u3002\u5bf9\u4e8e\u57fa\u672c\u7684 Xrdp \u94fe\u63a5\uff0c\u4f60\u4e0d\u9700\u8981\u5bf9\u914d\u7f6e\u6587\u4ef6\u505a\u4efb\u4f55\u6539\u52a8\u3002<\/p>\n<p>Xrdp \u4f7f\u7528\u9ed8\u8ba4\u7684 X Window \u684c\u9762\u73af\u5883\uff08\uff09Gnome or XFCE\uff09\u3002<\/p>\n<p>\u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u88ab\u547d\u540d\u4e3a\u00a0<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/yq.aliyun.com\/go\/articleRenderRedirect?url=https%3A%2F%2Flinux.die.net%2Fman%2F5%2Fxrdp.ini\" data-url=\"https:\/\/linux.die.net\/man\/5\/xrdp.ini\" rel=\"nofollow\" >xrdp.ini<\/a>\u3002\u8fd9\u4e2a\u6587\u4ef6\u88ab\u5206\u6210\u4e0d\u540c\u7684\u6bb5\uff0c\u5141\u8bb8\u4f60\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\uff0c\u4f8b\u5982\u5b89\u5168\uff0c\u76d1\u542c\u5730\u5740\uff0c\u521b\u5efa\u4e0d\u540c\u7684 xrdp \u767b\u5f55\u4f1a\u8bdd\u7b49\u3002<\/p>\n<p>\u4e0d\u7ba1\u4ec0\u4e48\u65f6\u5019\u4f60\u5bf9\u914d\u7f6e\u6587\u4ef6\u505a\u51fa\u4fee\u6539\uff0c\u4f60\u9700\u8981\u91cd\u542f Xrdp \u670d\u52a1\u3002<\/p>\n<p>Xrdp \u4f7f\u7528<code>startwm.sh<\/code>\u6587\u4ef6\u542f\u52a8 X \u4f1a\u8bdd\u3002\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u53e6\u5916\u4e00\u4e2a X Window \u684c\u9762\uff0c\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6\u3002<\/p>\n<p>\u521b\u5efa\u7cfb\u7edf\u81ea\u542f\u52a8# <strong>systemctl enable xrdp<\/strong><\/p>\n<p>systemctl status xrdp \u53d1\u73b0\u662fxrdp.service\u6587\u4ef6\u6ca1\u6709\uff0c\u624b\u52a8<strong>cp xrdp.service \/lib\/systemd\/system<\/strong><\/p>\n<h2 id=\"4\">\u56db\u3001\u914d\u7f6e\u9632\u706b\u5899<\/h2>\n<p>Xrdp \u5b88\u62a4\u7a0b\u5e8f\u5728\u6240\u6709\u7684\u7f51\u7edc\u63a5\u53e3\u4e0a\u76d1\u542c\u7aef\u53e3<code>3389<\/code>\u3002\u5982\u679c\u4f60\u5728\u4f60\u7684 Ubuntu \u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u4e00\u4e2a\u9632\u706b\u5899\uff0c\u4f60\u9700\u8981\u6253\u5f00 Xrdp \u7aef\u53e3\u3002<\/p>\n<p>\u60f3\u8981\u5141\u8bb8\u4ece\u67d0\u4e00\u4e2a\u6307\u5b9a\u7684 IP \u5730\u5740\u6216\u8005 IP \u8303\u56f4\u8bbf\u95ee Xrdp \u670d\u52a1\u5668\uff0c\u4f8b\u5982<code>192.168.33.0\/24<\/code>,\u4f60\u9700\u8981\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo ufw allow from 192.168.33.0\/24 to any port 3389<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u60f3\u5141\u8bb8\u4ece\u4efb\u4f55\u5730\u65b9\u8bbf\u95ee\uff08\u7531\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u9f13\u52b1\uff09\uff0c\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"bash hljs\">sudo ufw allow 3389<\/code><\/pre>\n<p>\u60f3\u8981\u589e\u52a0\u5b89\u5168\uff0c\u4f60\u53ef\u4ee5\u8003\u8651 Xrdp \u4ec5\u4ec5\u76d1\u542c localhost\uff0c\u5e76\u4e14\u521b\u5efa\u4e00\u4e2a SSH \u96a7\u9053\uff0c\u5c06\u672c\u5730\u673a\u5668\u7684<code>3389<\/code>\u7aef\u53e3\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u540c\u6837\u7aef\u53e3\u4e4b\u95f4\u7684\u6d41\u91cf\u52a0\u5bc6\u3002<\/p>\n<h2 id=\"5\">\u4e94\u3001\u8fde\u63a5 Xrdp \u670d\u52a1\u5668<\/h2>\n<p>\u73b0\u5728\u4f60\u5df2\u7ecf\u8bbe\u7f6e\u597d\u4f60\u7684 Xrdp \u670d\u52a1\u5668\uff0c\u662f\u65f6\u5019\u6253\u5f00\u4f60\u7684 Xrdp \u5ba2\u6237\u7aef\u5e76\u4e14\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6709\u4e00\u53f0 Windows \u7535\u8111\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u7684 RDP \u5ba2\u6237\u7aef\u3002\u5728 Windows \u641c\u7d22\u680f\u8f93\u5165\u201cremote\u201d\uff0c\u5e76\u4e14\u70b9\u51fb\u201cRemote Desktop Connection\u201d\u3002\u8fd9\u5c06\u4f1a\u6253\u5f00\u4e00\u4e2a RDP \u5ba2\u6237\u7aef\u3002\u5728\u201cComputer\u201d\u533a\u57df\u8f93\u5165\u8fdc\u7a0b\u670d\u52a1\u5668 IP\u5730\u5740\uff0c\u5e76\u4e14\u70b9\u51fb\u201cConnect\u201d\u3002<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/yqfile.alicdn.com\/ce23fb73e466900ed3885c7d79f2f4c4a54aaa1c.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe1\" alt=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe1\" \/><\/p>\n<p>\u5728\u767b\u5f55\u5c4f\u5e55\uff0c\u8f93\u5165\u4f60\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u70b9\u51fb\u201cOK\u201d\u3002<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/yqfile.alicdn.com\/8b53cca8cefa27f3e394d7c5d8381cadcd6a6a4a.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe2\" alt=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe2\" \/><\/p>\n<p>\u4e00\u65e6\u767b\u5f55\uff0c\u4f60\u5c06\u770b\u5230\u9ed8\u8ba4\u7684 Gnome \u6216\u8005 Xfce \u684c\u9762\uff0c\u5b83\u5e94\u8be5\u50cf\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<p><img decoding=\"async\" data-original=\"https:\/\/yqfile.alicdn.com\/959150d42b4919bd4c9ef91ceda305efee41de22.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" title=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe3\" alt=\"\u5982\u4f55\u5728Ubuntu 20.04 \u4e0a\u5b89\u88c5 Xrdp \u670d\u52a1\u5668\u8fdc\u7a0b\u684c\u9762\u63d2\u56fe3\" \/><\/p>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u4ece\u4f60\u7684\u672c\u5730\u673a\u5668\u4e0a\u4f7f\u7528\u4f60\u7684\u952e\u76d8\u548c\u9f20\u6807\u548c\u8fdc\u7a0b\u684c\u9762\u8fdb\u884c\u4ea4\u4e92\u4e86\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u8fd0\u884c macOS,\u4f60\u53ef\u4ee5\u4eceMac App Store\u5b89\u88c5 Microsoft Remote Desktop\u5e94\u7528\u3002 Linux \u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a RDP \u5ba2\u6237\u7aef\uff0c\u4f8b\u5982 Remmina \u6216\u8005 Vinagre\u3002<\/p>\n<h2 id=\"6\">\u516d\u3001\u603b\u7ed3<\/h2>\n<p>\u5982\u679c\u684c\u9762\u662f<strong>\u9ed1\u5c4f\u684c\u9762\u80cc\u666f<\/strong>\u7684\u9700\u8981\u914d\u7f6e.xsession\u6587\u4ef6 <strong><span class=\"token keyword\">echo<\/span> xfce4-session<span class=\"token operator\">&gt;<\/span> ~\/.xsession\u00a0<\/strong><\/p>\n<p>\u914d\u7f6e\u4e00\u4e2a\u8fdc\u7a0b\u684c\u9762\uff0c\u5141\u8bb8\u4f60\u4ece\u4f60\u7684\u672c\u5730\u673a\u5668\u901a\u8fc7\u4e00\u4e2a\u7b80\u5355\u6613\u7528\u7684\u56fe\u5f62\u754c\u9762\u6765\u7ba1\u7406\u4f60\u7684 Ubuntu 20.04 \u670d\u52a1\u5668\u3002<\/p>\n<p data-spm-anchor-id=\"a2c4e.11153940.0.i6.5adc6dd8WnLHAs\">\u5982\u679c\u4f60\u6709\u4efb\u4f55\u7591\u95ee\uff0c\u8bf7\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u8054\u7cfb\u6211\u4eec\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xrdp \u662f\u4e00\u4e2a\u5fae\u8f6f\u8fdc\u7a0b\u684c\u9762\u534f\u8bae\uff08RDP\uff09\u7684\u5f00\u6e90\u5b9e\u73b0\uff0c\u5b83\u5141\u8bb8\u4f60\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u63a7\u5236\u8fdc\u7a0b\u7cfb\u7edf\u3002\u901a\u8fc7 RDP\uff0c\u4f60\u53ef\u4ee5\u767b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,21],"tags":[471,257,353,267,268,269,256,266],"class_list":["post-779","post","type-post","status-publish","format-standard","hentry","category-linux","category-script","tag-js-bat","tag-linux-xrdp","tag-linux","tag-ubuntu-xrdp","tag-xfce","tag-xrdp","tag-266"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=779"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/779\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}