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
碰见错误了,链接不上,等待修复
分类:
linux
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix