Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fort/login_fort_record/ #64

Open
hx-2020 opened this issue Apr 2, 2020 · 7 comments
Open

fort/login_fort_record/ #64

hx-2020 opened this issue Apr 2, 2020 · 7 comments

Comments

@hx-2020
Copy link

hx-2020 commented Apr 2, 2020

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

@pythonzm
Copy link
Owner

pythonzm commented Apr 7, 2020

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

@hx-2020
Copy link
Author

hx-2020 commented Apr 8, 2020

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

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

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

@pythonzm
Copy link
Owner

pythonzm commented Apr 8, 2020

使用的chrome浏览器么?

@hx-2020
Copy link
Author

hx-2020 commented Apr 8, 2020

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

@pythonzm
Copy link
Owner

pythonzm commented Apr 9, 2020

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

@hx-2020
Copy link
Author

hx-2020 commented Apr 9, 2020

连上去不操作也会断,下面是打印连上后服务器端返回的信息
[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]

@pythonzm
Copy link
Owner

redis是不是设置密码了?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants