Ops icon indicating copy to clipboard operation
Ops copied to clipboard

fort/login_fort_record/

Open hx-2020 opened this issue 5 years ago • 7 comments

@pythonzm 你好,请问下如题这个页面逻辑是怎么样的,主机登录日志和连接管理登录日志看起来里面的字段是一样的,另外从assets/assets_list/里面ssh登录成功后,只能执行一条命令后ssh就会断开,我看后面webssh会话超时时间设置的是3分钟

hx-2020 avatar Apr 02 '20 08:04 hx-2020

主机登录日志是直接通过资产管理中设置的管理账号登录的记录,也就是管理员的登录记录。 连接管理登录日志是通过分配的账号登录的记录,也就是堡垒机的操作记录 执行命令断开的问题看console有什么报错没?或者自己修改过什么东西?

pythonzm avatar Apr 07 '20 14:04 pythonzm

没有修改过什么设置,console打印显示websocket连接成功后过了几秒异常disconect,错误代码1010

尝试更换channels,channels-redis高版本还是不行

我用的环境是Ubuntu16.04 python3.5

hx-2020 avatar Apr 08 '20 05:04 hx-2020

使用的chrome浏览器么?

pythonzm avatar Apr 08 '20 07:04 pythonzm

Chrome和firefox我都测试过了都一样报错code 1010

websocket disconnected:1011 (index):111

CloseEvent {isTrusted: true, wasClean: false, code: 1011, reason: "", type: "close", …} isTrusted: true wasClean: false code: 1011 reason: "" type: "close" target: WebSocket {url: "ws://192.168.216.152:8000/ws/webssh/1/?remote_ip=192.168.216.145&width=120&height=21", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …} currentTarget: WebSocket {url: "ws://192.168.216.152:8000/ws/webssh/1/?remote_ip=192.168.216.145&width=120&height=21", readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …} eventPhase: 0 bubbles: false cancelable: false defaultPrevented: false composed: false timeStamp: 10857.3800008744 srcElement: WebSocket {url: "ws://192.168.216.152:8000/ws/webssh/1/?remote_ip=192.168.216.145&width=120&height=21", readyState: 3, bufferedAmount: 0,

之前Pip install安装相关依赖包的时候有提示asig-redis版本不兼容, 尝试更换相应的版本websocket都没有办法建立连接 ERROR: asgi-redis 1.4.3 has requirement asgiref~=1.1.2, but you'll have asgiref 2.3.2 which is incompatible

hx-2020 avatar Apr 08 '20 07:04 hx-2020

连上之后,不执行命令会自动断开吗?

pythonzm avatar Apr 09 '20 06:04 pythonzm

连上去不操作也会断,下面是打印连上后服务器端返回的信息 [2020/04/09 15:20:36] HTTP GET /assets/ssh/2/ 200 [0.08, 192.168.216.145:57040] [2020/04/09 15:20:36] HTTP GET /static/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css 304 [0.04, 192.168.216.145:57040] [2020/04/09 15:20:36] HTTP GET /static/jquery-confirm/dist/jquery-confirm.min.css 304 [0.04, 192.168.216.145:57042] [2020/04/09 15:20:36] HTTP GET /static/bootstrap-fileinput/js/fileinput.min.js 304 [0.03, 192.168.216.145:57045] [2020/04/09 15:20:36] HTTP GET /static/AdminLTE/bower_components/jquery/dist/jquery.min.js 304 [0.04, 192.168.216.145:57043] [2020/04/09 15:20:36] HTTP GET /static/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js 304 [0.04, 192.168.216.145:57044] [2020/04/09 15:20:36] HTTP GET /static/js/xterm.js 304 [0.04, 192.168.216.145:57046] [2020/04/09 15:20:36] HTTP GET /static/jquery-confirm/dist/jquery-confirm.min.js 304 [0.03, 192.168.216.145:57042] [2020/04/09 15:20:36] HTTP GET /static/js/fit.js 304 [0.04, 192.168.216.145:57040] [2020/04/09 15:20:36] HTTP GET /static/css/xterm.css 200 [0.03, 192.168.216.145:57043] [2020/04/09 15:20:36] HTTP GET /static/bootstrap-fileinput/css/fileinput.min.css 200 [0.03, 192.168.216.145:57045] [2020/04/09 15:20:36] WebSocket HANDSHAKING /ws/webssh/2/ [192.168.216.145:57047] 163 40 [2020/04/09 15:20:36] WebSocket CONNECT /ws/webssh/2/ [192.168.216.145:57047] the connect is ok the self ip is %s 172.16.103.155 the str_data is Last login: Thu Apr 9 03:15:55 2020 from 172.16.41.22 the str_data is [root@sh-fa-02 ~]# [2020/04/09 15:20:46] WebSocket DISCONNECT /ws/webssh/2/ [192.168.216.145:57047]

hx-2020 avatar Apr 09 '20 07:04 hx-2020

redis是不是设置密码了?

pythonzm avatar Apr 11 '20 12:04 pythonzm