The remote proxy closed the connection while negotiating the session. This may be due to the wrong authentication credentials passed to the server.

x2goserver 运行在Ubuntu 12.04.5 LTS上

安装好后x2go客户端连接不上,报如下错误:

The remote proxy closed the connection while negotiating the session. This may be due to the wrong authentication credentials passed to the server.

截图如下:

首先查看x2goserver 服务器端的日志 /var/log/syslog 并无异常,截取部分结果如下:

May 24 13:16:44 ubuntu /usr/sbin/x2gocleansessions[29064]: user-51-1464067003_stDGNOME_dp32: state file for this session does not exist: /tmp/.x2go-user/C-user-51-1464067003_stDGNOME_dp32/state (this can be ignored during session startups)
May 24 13:16:45 ubuntu /usr/bin/x2gostartagent: successfully started X2Go agent session with ID user-51-1464067003_stDGNOME_dp32

接着多次用x2go客户端连接x2goserver并在服务器端用netstat -tuplen | grep x2go* 查看结果,发现x2goserver除了使用ssh端口外还在监听某个tcp端口(大于30000),某次grep结果如下

于是先在iptables中加入如下规则,开启30013端口

sudo iptables  -I INPUT 1 -p tcp --dport 30013 -j ACCEPT

用x2go 客户端重新连接,成功!

但是x2goserver的这个监听端口并不固定,所以这个解决方法不是一劳永逸的而且危险。通过google大量查找终于找到了靠谱的解决方法,大意就是x2goserver使用了nxclient的库文件,需要某种本地ssh代理,并且要在30001端口监听,因此需要在防火墙上打开这个端口。具体如下:

# x2go
-A INPUT -p tcp -m tcp -s 127.0.0.1/32 --dport 30001 -j ACCEPT
-A INPUT -p tcp -m tcp -s 127.0.0.1/32 --dport 30002 -j ACCEPT
-A INPUT -p tcp -m tcp -s 127.0.0.1/32 --dport 30003 -j ACCEPT

而上面的截图中端口明显大于30003,所以我干脆把30001~30099的本地tcp端口全部打开

命令如下:

iptables -I INPUT 1 -p tcp -m tcp -s 127.0.0.1/32 --dport 30001:30099 -j ACCEPT

用x2go客户端连接,成功 :)

最新文章

  1. 安装 whmcs
  2. 学习笔记-Java编程思想
  3. LeetCode OJ-- 二战 Combinations
  4. RabbitMQ 问题记录
  5. cuda并行计算的几种模式
  6. Hadoop实战第一篇
  7. Android数据的四种存储方式
  8. jfinal想用到中大型项目中的项目经验分享
  9. 自定义控件 进度条 ProgressBar-2
  10. sde需要注意的几个常见问题
  11. 从content-type设置看Spring MVC处理header的一个坑
  12. Jquery字符串,数组(拷贝、删选、合并等),each循环,阻止冒泡,ajax出错,$.grep筛选,$.param序列化,$.when
  13. linux目录2
  14. 2019阿里校招测评题,光明小学完全图最短路径问题(python实现)
  15. 快速排序算法回顾 (Python实现)
  16. 利用python脚本(re)抓取美空mm图片
  17. Redhat配置yum源(使用阿里云yum Repo)
  18. [Tensorflow] Cookbook - The Tensorflow Way
  19. Quartz代码及配置详解(转)
  20. OC中双向链表的实现

热门文章

  1. 搭建一个简单的React项目
  2. 模板、中间件以及MVC与MTV
  3. JavaScript中进制和字符编码问题
  4. centos7 安装jdk及mysql8
  5. javascript_04-类型转换
  6. 【nodejs代理服务器四】代理服务器增加频繁访问的ip加入黑名单
  7. 虚拟dom应用
  8. modbus字符串的结束符介绍
  9. 基于TCP协议套接字,服务端实现接收客户端的连接并发
  10. google Guava包的reflection(反射)解析