找回密码
 立即注册
搜索
查看: 243|回复: 0

Centos7安装Xrdp远程桌面服务

[复制链接]

986

主题

92

回帖

5万

积分

管理员

积分
55255
发表于 2022-6-23 09:05:01 | 显示全部楼层 |阅读模式
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
  1. [root@localhost ~]# yum grouplist
    * J0 Z* [& t8 D7 F( ^
  2. Loaded plugins: fastestmirror3 W, y0 {4 D4 v
  3. There is no installed groups file.
    * Q& Z% r0 W8 L% `! q$ L1 y0 I( K9 ^
  4. Maybe run: yum groups mark convert (see man yum)
    / l7 ]% r8 M( v9 Q8 J/ s- J6 ^
  5. Loading mirror speeds from cached hostfile' @! k. d  i8 C4 E
  6. * base: mirrors.tuna.tsinghua.edu.cn) y! d2 f+ Z9 ]& N3 {
  7. * epel: mirrors.aliyun.com& Z7 N* y" f4 i' G
  8. * extras: mirrors.aliyun.com; o3 B8 {4 K* o5 L2 R( `; \! X
  9. * updates: mirrors.aliyun.com
    , E% w$ P& y: V& ~2 d& B' _
  10. Available Environment Groups:, L0 n- ~; G, M. Z: ]4 D
  11.    Minimal Install* }) \# g: r; X9 ^# k
  12.    Compute Node. ^+ j; s& }) w$ c
  13.    Infrastructure Server( K. F  K% }0 i& E: n$ X
  14.    File and Print Server/ L* H1 q* V" ]& `
  15.    Cinnamon Desktop1 P. J* l* i: g- ^/ @% u& `
  16.    MATE Desktop
    0 z2 Y1 @2 X5 b; s4 c( \
  17.    Basic Web Server! \$ d( w: P- B' `9 B
  18.    Virtualization Host* C& H8 d9 N: v+ y; g  R3 f2 a
  19.    Server with GUI6 M% C. ]) e6 ?$ G3 a  z
  20.    GNOME Desktop
    1 i3 \0 A4 r* ]& k7 X7 Q
  21.    KDE Plasma Workspaces5 g1 D9 g# y& D0 W' N1 k
  22.    Development and Creative Workstation
    ' c0 j9 t# C, u$ V
  23. Available Groups:
    " M) d  T# i: A# r4 x4 ?
  24.    Cinnamon
    7 _2 c# U6 [  s
  25.    Compatibility Libraries
    - ?; d5 G8 ^( E( @% {7 ~
  26.    Console Internet Tools
    - _9 G5 [- j* R" i
  27.    Development Tools
    / a1 h- z. B) L: W
  28.    Educational Software
    : {' P2 N* K% R* ?4 {
  29.    Electronic Lab
      k5 A# @! _: _( W) B: L
  30.    Fedora Packager1 }+ ~! P/ B* P2 C. E+ D
  31.    General Purpose Desktop! I  {) [9 f$ `4 ^
  32.    Graphical Administration Tools6 P. x$ N; g4 V5 [9 _; I
  33.    Haskell1 L0 e/ ~: w5 y  _$ e
  34.    LXQt Desktop( O# v: T* o4 S9 ]$ ?
  35.    Legacy UNIX Compatibility8 z# {; O, Y' o3 x9 r5 A
  36.    MATE- ~6 ^0 V! D$ H5 P
  37.    Milkymist1 e8 ?2 @9 Y- T. M* i8 r' y
  38.    Scientific Support* Z; @  t: b! j- ~8 \* k9 a$ H  z
  39.    Security Tools. x! b1 l+ v* \8 c
  40.    Smart Card Support- W1 n7 H) [. }* s) r
  41.    System Administration Tools
    $ h( x" A& r& z' K1 C' \
  42.    System Management$ J3 n9 _+ h. s7 x1 ]3 d
  43.    TurboGears application framework0 B* r# d0 H0 p2 p8 Y# D
  44.    Xfce8 Q, W- W5 R2 ~) V5 T4 e. D! C5 U  P
  45. Done
复制代码
5 V0 @8 z; ~2 E8 K' V+ h9 P# _
- B+ E: X. C* q% z
我们可以选择自己喜欢的桌面环境,在这里选择安装Xfce桌面:( t/ N0 ~- [5 t  t0 S
  1. [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
  1. [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
  1. [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# `
  1. [root@localhost ~]# echo "xfce4-session" > ~/.Xclients* ~% L1 c' j0 U
  2. [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; \
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|

GMT+8, 2026-3-22 01:07 AM , Processed in 0.131344 second(s), 23 queries .

Powered by xyh-moon X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表