|
|
Xrdp是Microsoft远程桌面协议(RDP)的一个开源实现,它允许以图形方式控制远程系统。使用RDP,您可以登录到远程计算机并创建一个真正的桌面会话,就像您登录到本地计算机一样。
& {" X- G* q p) S. O系统环境
, r( \0 z8 ~, y9 l$ Q. v; X- 服务端:Centos7.7 Minimal
- 客户端:Windows10
7 n2 a3 r. W/ u% Y! X 安装桌面环境- X: S4 W a, J: ~( Z; _7 w# }
本实验中安装的系统没有安装桌面环境,我们需要自己安装,如果已经安装桌面了清跳过这一步。Centos7提供了"Cinnamon Desktop","MATE Desktop","GNOME Desktop","KDE Plasma Workspaces","LXQt Desktop","Xfce"让我们安装。
$ S/ D' V' _$ D% K$ r" X% X下面的命令列出可用环境组:5 g1 N1 c7 U/ v4 ^% i
- [root@localhost ~]# yum grouplist
* J0 Z* [& t8 D7 F( ^ - Loaded plugins: fastestmirror3 W, y0 {4 D4 v
- There is no installed groups file.
* Q& Z% r0 W8 L% `! q$ L1 y0 I( K9 ^ - Maybe run: yum groups mark convert (see man yum)
/ l7 ]% r8 M( v9 Q8 J/ s- J6 ^ - Loading mirror speeds from cached hostfile' @! k. d i8 C4 E
- * base: mirrors.tuna.tsinghua.edu.cn) y! d2 f+ Z9 ]& N3 {
- * epel: mirrors.aliyun.com& Z7 N* y" f4 i' G
- * extras: mirrors.aliyun.com; o3 B8 {4 K* o5 L2 R( `; \! X
- * updates: mirrors.aliyun.com
, E% w$ P& y: V& ~2 d& B' _ - Available Environment Groups:, L0 n- ~; G, M. Z: ]4 D
- Minimal Install* }) \# g: r; X9 ^# k
- Compute Node. ^+ j; s& }) w$ c
- Infrastructure Server( K. F K% }0 i& E: n$ X
- File and Print Server/ L* H1 q* V" ]& `
- Cinnamon Desktop1 P. J* l* i: g- ^/ @% u& `
- MATE Desktop
0 z2 Y1 @2 X5 b; s4 c( \ - Basic Web Server! \$ d( w: P- B' `9 B
- Virtualization Host* C& H8 d9 N: v+ y; g R3 f2 a
- Server with GUI6 M% C. ]) e6 ?$ G3 a z
- GNOME Desktop
1 i3 \0 A4 r* ]& k7 X7 Q - KDE Plasma Workspaces5 g1 D9 g# y& D0 W' N1 k
- Development and Creative Workstation
' c0 j9 t# C, u$ V - Available Groups:
" M) d T# i: A# r4 x4 ? - Cinnamon
7 _2 c# U6 [ s - Compatibility Libraries
- ?; d5 G8 ^( E( @% {7 ~ - Console Internet Tools
- _9 G5 [- j* R" i - Development Tools
/ a1 h- z. B) L: W - Educational Software
: {' P2 N* K% R* ?4 { - Electronic Lab
k5 A# @! _: _( W) B: L - Fedora Packager1 }+ ~! P/ B* P2 C. E+ D
- General Purpose Desktop! I {) [9 f$ `4 ^
- Graphical Administration Tools6 P. x$ N; g4 V5 [9 _; I
- Haskell1 L0 e/ ~: w5 y _$ e
- LXQt Desktop( O# v: T* o4 S9 ]$ ?
- Legacy UNIX Compatibility8 z# {; O, Y' o3 x9 r5 A
- MATE- ~6 ^0 V! D$ H5 P
- Milkymist1 e8 ?2 @9 Y- T. M* i8 r' y
- Scientific Support* Z; @ t: b! j- ~8 \* k9 a$ H z
- Security Tools. x! b1 l+ v* \8 c
- Smart Card Support- W1 n7 H) [. }* s) r
- System Administration Tools
$ h( x" A& r& z' K1 C' \ - System Management$ J3 n9 _+ h. s7 x1 ]3 d
- TurboGears application framework0 B* r# d0 H0 p2 p8 Y# D
- Xfce8 Q, W- W5 R2 ~) V5 T4 e. D! C5 U P
- Done
复制代码 5 V0 @8 z; ~2 E8 K' V+ h9 P# _
- B+ E: X. C* q% z
我们可以选择自己喜欢的桌面环境,在这里选择安装Xfce桌面:( t/ N0 ~- [5 t t0 S
- [root@localhost ~]# yum -y install epel-release && yum groupinstall Xfce
复制代码 5 k; a- b. O( |3 j) b# ?5 F
- P, C( @# }) Z$ A
安装Xrdp
6 n% ] \' b9 O- [root@localhost ~]# yum -y install xrdp
复制代码
- B) F8 B1 Y) e% k. k
7 ^2 A) m1 ], I6 G安装完成之后,设置开机启动并启动xrdp+ K3 _/ r" P4 P+ w& ^) j
- [root@localhost ~]# systemctl start xrdp && systemctl enable xrdp
复制代码 , C" T1 \: ?5 F) W, |# o5 Y7 c
8 O2 d0 X8 A6 d: ?! K创建~/.Xclients,设置默认启动xfce4桌面
& B6 V3 k" U7 Q5 w/ }, O# `- [root@localhost ~]# echo "xfce4-session" > ~/.Xclients* ~% L1 c' j0 U
- [root@localhost ~]# chmod +x .Xclients
复制代码 + w5 V/ N: G, q1 q
, m% H) ~2 C9 d3 O
在客户端远程连接
, [9 |' q0 R+ w% p" H1 _0 ?& j/ c
8 X" |( c5 A/ N" O. Z$ a
/ Y D/ ^6 ?! T, O/ s" V - D' n& @, m# W4 a5 P! D
总结5 h5 |+ ]2 E' f: I2 f' _' \ w
安装Xrdp服务器允许您通过图形界面从本地管理CentOS 7服务器。
4 s5 t- H4 j5 W( c! Z9 V0 x; @
$ ~4 n$ o. }! b+ T. J) ^0 e) R" o2 V* p) J; \
|
|