我有一些麻烦
我想使用 xrdp 和 mstsc 从远程系统(即 Windows7)连接到 kali。
所以我安装了 xrdp 服务并运行,接下来我尝试从 Windows 进行连接,但它不起作用,并且没有错误消息。
所以我检查了/var/log/xrdp.log,并得到了一些线索。
它说:
[20160725-14:03:37] [INFO ] A connection received from: 0.0.0.0 port 9036
[20160725-14:03:37] [INFO ] An established connection closed to endpoint: 0.0.0.0:9036 - socket: 11
[20160725-14:03:37] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 10
[20160725-14:03:37] [CORE ] WARNING: Invalid x.509 certificate path defined, default path will be used: /etc/xrdp/cert.pem
[20160725-14:03:37] [WARN ] Invalid X.509 certificate path defined, default path will be used: /etc/xrdp/key.pem
[20160725-14:03:37] [DEBUG] xrdp_000014b6_wm_login_mode_event_00000001
[20160725-14:03:37] [WARN ] local keymap file for 0xe0010412 found and doesn't match built in keymap, using local keymap file
[20160725-14:03:51] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
[20160725-14:03:55] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
[20160725-14:03:59] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
[20160725-14:04:03] [ERROR] Failure to connect to sesman: 127.0.0.1 port: 3350
[20160725-14:04:03] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16
[20160725-14:04:03] [DEBUG] return value from xrdp_mm_connect 1
[20160725-14:24:56] [INFO ] An established connection closed to endpoint: 0.0.0.0:9036 - socket: 11
[20160725-14:24:56] [DEBUG] xrdp_mm_module_cleanup
[20160725-14:24:56] [ERROR] Listening socket is in wrong state we terminate listener
我用关键字“定义的 X.509 证书路径无效”进行搜索并得到一些解决方案。
chcon:无法将部分上下文应用于未标记的文件“/usr/sbin/xrdp”
我尝试了一下,但也失败了:
root@kali:~# chcon -u system_u -r object_r --type=bin_t /usr/sbin/xrdp
chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'
我怎么解决这个问题?
添加
root@kali:~# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: default
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
答案1
线索是这样的xrdp.log
:
[20160725-14:04:03] [ERROR] Failure to connect to sesman: 127.0.0.1 port: 3350
尝试使用以下方法之一启动服务 xrdp-sesman:
$ service xrdp-sesman start
或者
$ systemctl start xrdp-sesman