kavo

Linux 下 Centos 后者 debian 安装 Xrdp

手上有一台测试用的 Centos6 环境,接下来做安装 Xrdp 演示:

最后先执行,防止出现 yum 包不存在报错:No package xrdp available

yum install epel-release
yum install -y xrdp vnc-server tigervnc-server

 

然后修改配置文件:/etc/sysconfig/vncservers 这个配置文件我在安装头两个 xrdp 和 vnc-server 时不存在,直到安装了 tigervnc-server 后才有的,结尾添加两行图下。

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.  
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see this URL:
# https://access.redhat.com/knowledge/solutions/7027

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

VNCSERVERS="2:root"
VNCSERVERARGS[1]="-geometry 1280x720"

 注意 root 为登录账户,如果设置不存在的系统账户,请先添加系统账户

执行 vncpasswd 设置登录密码:

#输入两次密码
vncpasswd
Password:
Verify:

刚开始设置的账号为 admin ,但是提示用户不存在

[root@xx sysconfig]# service vncserver start
Starting VNC server: 2:admin runuser: user admin does not exist
                                                           [FAILED]
[root@xx sysconfig]# service vncserver start

为了省事,就不添加用户,直接将用户设置为 root

然后启动 vncserver 和 xrdp

[root@xx sysconfig]# service vncserver start
Starting VNC server: 2:root xauth:  file /root/.Xauthority does not exist
xauth: (stdin):1:  bad display name "vovovo:2" in "add" command

New 'xx:2 (root)' desktop is vovovo:2

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/vovovo:2.log
 
                                                           [  OK  ]
[root@xx sysconfig]# 
[root@xx sysconfig]# service xrdp start
Starting xrdp:                                             [  OK  ]
Starting xrdp-sesman:                                      [  OK  ]

注意,请记得开启 3389 端口,或者关闭防火墙

设置永久启动:

chkconfig xrdp on
chkconfig vncserver on

碰见错误了,链接不上,等待修复

posted on 2020-01-08 18:25  下雨天唱情歌  阅读(39)  评论(0编辑  收藏  举报  来源

导航