centos7安装Xrdp报错连接5910端口错误
环境 centos7.4,Xrdp 0.9版本
我们在用yum安装完成Xrdp后进行远程登陆时候输入用户密码后,登陆报错如图形式
1111111.jpg
通过图中信息我们可以判断密码验证是通过的。后面在连接5910时候出现错误。
然后用SSH连接服务器查看端口 netstat -tnl
查看会发现5910端口没有被使用起来
然后查看Xrdp日志记录 vi /var/log/xrdp-sesman.log
2222222.jpg错误代码
[20180413-02:56:43] [INFO ] A connection received from 127.0.0.1 port 57020
[20180413-02:56:44] [INFO ] ++ created session (access granted): username root, ip 61.166.253.113:42721 - socket: 12
[20180413-02:56:44] [INFO ] starting Xvnc session…
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5910)
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6010)
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6210)
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5911)
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6011)
[20180413-02:56:44] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6211)
[20180413-02:56:44] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20180413-02:56:44] [INFO ] calling auth_start_session from pid 21133
[20180413-02:56:44] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20180413-02:56:44] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20180413-02:56:44] [INFO ] Xvnc :11 -auth .Xauthority -geometry 800x600 -depth 32 -rfbauth /root/.vnc/sesman_passwd-root@VM_101_127_centos:11 -bs -nolisten tcp -localhost -dpi 96
[20180413-02:56:44] [CORE ] waiting for window manager (pid 21134) to exit
[20180413-02:56:44] [CORE ] window manager (pid 21134) did exit, cleaning up session
[20180413-02:56:44] [INFO ] calling auth_stop_session and auth_end from pid 21133
[20180413-02:56:44] [DEBUG] cleanup_sockets:
[20180413-02:56:44] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_socket_11
[20180413-02:56:44] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_11
[20180413-02:56:44] [DEBUG] cleanup_sockets: failed to delete /tmp/.xrdp/xrdpapi_11
[20180413-02:56:44] [INFO ] ++ terminated session: username root, display :11.0, session_pid 21133, ip 61.166.253.113:42721 - socket: 12
从这里看出来问题
我们需要检查我们的服务器是否安装了带GUI的服务器,其次就是是否启动了gdm.service服务
如果是centos是mini版本那么我们需要用yum安装下
sudo yum install @gnome-desktop
安装完成后再启动下
sudo systemctl enable gdm.service
然后重启xrdp服务
systemctl restart xrdp
image.png