translated

This commit is contained in:
geekpi 2021-06-03 08:57:50 +08:00
parent 64753c6dec
commit 75449e94d5
2 changed files with 183 additions and 182 deletions

View File

@ -1,182 +0,0 @@
[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection)
[#]: via: (https://itsfoss.com/xrdp-ubuntu/)
[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Install and Use XRDP on Ubuntu for Remote Desktop Connection
======
_**Brief: This is a beginners guide that shows the steps you need to follow for setting up XRDP on Ubuntu-based Linux distributions. With that, you can access your Ubuntu system from a different computer and use it graphically.**_
[Microsoft Remote Desktop Protocol][1](RDP) is a protocol that allows for graphical remote desktop connections from one computer to another. RDP works by having a main machine run software that allows several other computers to connect to it.
[XRDP][2] is an open-source implementation of RDP, removing the need to run any proprietary programs. XRDP not only tries to follow in the direction of RDP, but is also compatible with regular RDP clients such as [Remmina][3] and [GNOME Boxes][4].
Heres what the XRDP connection screen looks like.
![][5]
### Things to keep in mind about using XRDP
While XRDP works great for getting remote access to machine, its important to know what XRDP _**isnt**_ good at.
#### Do _n**ot**_ use XRDP if you need a secure connection
Connections made over XRDP can be viewed and modified by attackers, and should thus be avoided for any sensitive information. This can be alleviated through the use of an SSH connection or certificates, but both require a more complex setup and wont be covered here.
#### XRDP doesnt work well with theming by default
In my testing, XRDP didnt ever seem to apply the theming [Ubuntu][6] comes with by default. Instructions for fixing this are available at the end of the article.
#### You need a desktop environment installed on the remote computer
Youll need a graphical environment installed on the machine everything will connect to for any of this to work. If you are using a desktop Linux to be accessed remotely, its all good.
But if you are using a server operating system, it wont work. Of course, [you can install GUI on your Ubuntu server][7] but youll be a lot better using SSH to use the remote system via command line.
### Using XRDP to connect to a Ubuntu Linux system remotely
Heres the setup you need for this remote connection setup to work properly.
* A Linux system with XRDP server installed on it. This is the system which will be accessed remotely.
* The remote system should either be on the same network as yours or it should have a public IP address.
* You need to know the username and password of the remote Linux system, obviously.
* Another system (be it Linux, macOS or Windows) with an RDP client installed on it.
![][8]
The process is really simple. Lets see it in steps.
#### Step 1: Install XRDP on the remote computer
I am calling it remote computer for reference only. Of course, you need to have access to it in the first place for installing the XRDP package.
XRDP is included in the repositories of most distributions. On Ubuntu, you can find it in the universe repository and install it using this command:
```
sudo apt install xrdp
```
#### Step 2: Get the IP address of the remote computer
Youll need the IP address of the remote system in order to connect to it. You can [get the IP address in Linux][9] using the ip command:
```
ip address
```
As you can see, the system in the example has IP address 192.168.0.107. This is on the subnet, of course.
```
[email protected]:~$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3
valid_lft 6183sec preferred_lft 6183sec
```
#### Step 3: Connecting to a XRDP machine from local computer
The good news is that XRDP works right out of the box!
To connect to the machine you installed XRDP on, youll first need to install an RDP client on your local system (from where you are trying to connect to the remote system).
Ill be using GNOME Boxes in this tutorial, which can be installed with the following:
```
sudo apt install gnome-boxes
```
GNOME Boxes is primarily used for virtual machines but it is also a good XRDP client. You may use other tools like Remmina.
Start the GNOME Boxes application. Click on the + sign and select “**Connect to a Remote Computer…**“.
![][10]
Next, enter the IP address of the machine youre connecting to, prefixed with `rdp://`, and then connect as shown below:
![][11]
In the above example, I deployed an Ubuntu server on Linode cloud server. I also installed GNOME desktop on it. This server has a public IP address that can be accessed from anywhere. I have used the public IP address.
You should then be presented with a login screen. Keep “Session” set to “Xorg”, and just enter your username and password, then click “OK”:
![][5]
After, you should be presented with your desktop:
![][12]
And now youre good to go! Everything will (mostly more on that below) behave just the same as if the machine was right in front of you.
### Troubleshooting: Fixing theming issues with XRDP connection
In my testing on Ubuntu 20.04, the default Yaru theme didnt seem to apply by default when connecting over. This can be fixed with some effort.
First, run this command on the **remote computer**:
```
sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y
```
Next, open the Extensions app, and turn on the toggles shown below:
![][13]
Next, close your remote desktop session and log back in. Now, open up Tweaks and configure everything per the screenshot below:
![][14]
Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below:
* `custom-theme-shrink`: On
* `dock-fixed`: On
* `transparency-mode`: FIXED
And there you go, everything is good to go!
### Wrapping up
This should help you get started with XRDP on Ubuntu and other Linux systems. This is a convenient tool for connecting to remote systems, specially on the same network.
If something didnt work quite right, or you just have any questions or comments, feel free to leave them below. Ill try to help you out.
--------------------------------------------------------------------------------
via: https://itsfoss.com/xrdp-ubuntu/
作者:[Hunter Wittenborn][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/hunter/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol
[2]: https://en.wikipedia.org/wiki/Xrdp
[3]: https://remmina.org/
[4]: https://wiki.gnome.org/Apps/Boxes
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1
[6]: https://ubuntu.com/
[7]: https://itsfoss.com/install-gui-ubuntu-server/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1
[9]: https://itsfoss.com/check-ip-address-ubuntu/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1

View File

@ -0,0 +1,183 @@
[#]: subject: (How to Install and Use XRDP on Ubuntu for Remote Desktop Connection)
[#]: via: (https://itsfoss.com/xrdp-ubuntu/)
[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
如何在 Ubuntu 上安装和使用 XRDP 进行远程桌面连接
======
_**简介:这是一份初学者指南,展示了在基于 Ubuntu 的 Linux 发行版上设置 XRDP 所需要遵循的步骤。有了它,你就可以从不同的电脑上访问你的 Ubuntu 系统,并以图形方式使用它。**_
[微软远程桌面协议][1] RDP 是一个允许从一台计算机到另一台计算机进行图形化远程桌面连接的协议。RDP 的工作原理是让一台主机运行软件,允许其他几台计算机连接到它。
[XRDP][2] 是 RDP 的一个开源实现不需要运行任何专有程序。XRDP 不仅试图遵循 RDP而且还与常规的 RDP 客户端兼容,如 [Remmina][3] 和 [GNOME Boxes][4]。
下面是 XRDP 连接屏幕的样子。
![][5]
### 使用 XRDP 需要注意的事项
虽然 XRDP 对于机器的远程访问非常好,但重要的是要知道 XRDP _**不**_擅长什么。
#### 如果你需要一个安全的连接请_**不要**_使用 XRDP
通过 XRDP 建立的连接可以被攻击者查看和修改,因此应避免使用任何敏感信息。这一点可以通过使用 SSH 连接或证书来缓解,但这两者都需要更复杂的设置,这里就不一一介绍了。
#### XRDP 在默认情况下不能很好地显示主题
在我的测试中XRDP 默认似乎从未应用过 [Ubuntu][6] 主题。在文章的结尾处有关于解决这个问题的说明。
#### 你需要在远程计算机上安装一个桌面环境
你需要在所有要连接的机器上安装一个图形环境,这样才能工作。如果你使用的是远程访问的桌面 Linux这就很好。
但是,如果你使用的是服务器操作系统,它就无法工作。当然,[你可以在你的 Ubuntu 服务器上安装 GUI][7],但你使用 SSH 通过命令行来使用远程系统会好很多。
### 使用 XRDP 来远程连接 Ubuntu Linux 系统
下面是这个远程连接设置正常工作所需的设置。
* 一个安装了 XRDP 服务器的 Linux 系统。这是一个将被远程访问的系统。
* 远程系统应该和你的系统在同一个网络上,或者它应该有一个公共 IP 地址。
* 显然,你需要知道远程 Linux 系统的用户名和密码。
* 另一个系统(无论是 Linux、macOS 还是 Windows上安装有 RDP 客户端。
![][8]
这个过程其实很简单。让我们分步骤来看。
#### 第 1 步:在“远程计算机”上安装 XRDP
我称它为远程计算机只是为了参考。当然,你首先需要访问它,以便安装 XRDP 包。
XRDP 包含在大多数发行版的软件库中。在 Ubuntu 上,你可以在 universe 库中找到它,并使用这个命令安装它:
```
sudo apt install xrdp
```
#### 第 2 步:获取“远程计算机”的 IP 地址
你将需要远程系统的 IP 地址,以便连接到它。你可以[在 Linux 中获取 IP 地址][9] 中使用 ip 命令:
```
ip address
```
正如你所看到的,例子中的系统的 IP 地址是 192.168.0.107。当然,这是在子网中。
```
[email protected]:~$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3
valid_lft 6183sec preferred_lft 6183sec
```
#### 第 3 步:从“本地计算机”连接到 XRDP 机器
好消息是XRDP 开箱就能使用!
要连接到你安装了 XRDP 的机器,你首先需要在你的本地系统上安装一个 RDP 客户端(从你试图连接到远程系统的电脑)。
在本教程中,我将使用 GNOME Boxes它可以通过以下方式安装
```
sudo apt install gnome-boxes
```
GNOME Boxes 主要用于虚拟机,但它也是一个好的 XRDP 客户端。你可以使用其他工具,如 Remmina。
启动 GNOME Boxes 应用。点击 + 号,选择 “**Connect to a Remote Computer…**”。
![][10]
接下来,输入你要连接的机器的 IP 地址,前缀为 `rdp://`,然后按下图连接:
![][11]
在上面的例子中,我在 Linode 云服务器上部署了一台 Ubuntu 服务器。我还在上面安装了 GNOME 桌面。这台服务器有一个公共 IP 地址,可以从任何地方访问。我用的是这个公共 IP 地址。
然后,你应该会看到一个登录页面。将“会话”设置为 “Xorg”只需输入你的用户名和密码然后点击 “OK”。
![][5]
之后,你应该看到你的桌面:
![][12]
现在完成了!一切都将(基本上,下面会有更多)会和机器在你面前一样。
### 故障排除:修复 XRDP 连接的主题问题
在我对 Ubuntu 20.04 的测试中,默认的 Yaru 主题似乎在连接时没有应用。这可以通过一些努力来解决。
首先,在**远程计算机**上运行这个命令:
```
sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y
```
接下来,打开 Extensions 应用,并打开如下开关:
![][13]
接下来,关闭你的远程桌面会话并重新登录。现在,打开 Tweaks按照下面的截图配置
![][14]
Lastly, open up dconf Editor, and navigate to `/org/gnome/shell/extensions/dash-to-dock/`. Set the values that are shown below:
最后,打开 dconf 编辑器,并进入 `/org/gnome/shell/extensions/dash-toock/`。设置如下所示的值:
* `custom-theme-shrink`: On
* `dock-fixed`: On
* `transparency-mode`: FIXED
完成了,你可以正常使用了!
### 总结
这应该可以帮助你在 Ubuntu 和其他 Linux 系统上开始使用 XRDP。这是一个连接到远程系统的方便工具特别是在同一网络上。
如果有什么地方做得不太对,或者你有什么问题或意见,请在下面留言。我会尽力帮助你的。
--------------------------------------------------------------------------------
via: https://itsfoss.com/xrdp-ubuntu/
作者:[Hunter Wittenborn][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/hunter/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol
[2]: https://en.wikipedia.org/wiki/Xrdp
[3]: https://remmina.org/
[4]: https://wiki.gnome.org/Apps/Boxes
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_login.png?resize=716%2C582&ssl=1
[6]: https://ubuntu.com/
[7]: https://itsfoss.com/install-gui-ubuntu-server/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp-ubuntu.png?resize=800%2C450&ssl=1
[9]: https://itsfoss.com/check-ip-address-ubuntu/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_connect-begin.png?resize=744%2C580&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_gnome-boxes_rdp-connect.png?resize=757%2C514&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_connected_homescreen.png?resize=711%2C595&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_extensions.png?resize=800%2C557&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/xrdp_tweaks.png?resize=800%2C550&ssl=1