shibingli / webconsole Goto Github PK
View Code? Open in Web Editor NEW基于Golang、WebSocket、xTermJS 的 Web SSH 远程终端
Home Page: https://webconsole.realclouds.org
License: Apache License 2.0
基于Golang、WebSocket、xTermJS 的 Web SSH 远程终端
Home Page: https://webconsole.realclouds.org
License: Apache License 2.0
一,centos 7.2
1,yum -y install go
2, go版本
[root@devel apibox]# go version
go version go1.8.3 linux/amd64
二,生成webconsole步骤如下
1,ssh.InsecureIgnoreHostKey报错
[root@devel apibox]# GOPATH=/root/webconsole go install
../website/console.go:35: undefined: ssh.InsecureIgnoreHostKey
2,根据网上方案解决,
删除crypto
[root@devel apibox]# rm -rf /root/webconsole/src/golang.org/x/crypto
You have new mail in /var/spool/mail/root
[root@devel apibox]# cd /root/webconsole/src/golang.org/x/
重新下载crypto
[root@devel x]# git clone https://github.com/golang/crypto.git
Cloning into 'crypto'...
remote: Counting objects: 3984, done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 3984 (delta 9), reused 23 (delta 6), pack-reused 3919
Receiving objects: 100% (3984/3984), 2.95 MiB | 296.00 KiB/s, done.
Resolving deltas: 100% (2507/2507), done.
[root@devel x]# cd -
/root/webconsole/src/apibox.club/apibox
重新安装
[root@devel apibox]# GOPATH=/root/webconsole go install
结果没有
[root@devel apibox]# ll /root/webconsole/conf/
total 8
-rw-r--r-- 1 root root 889 Dec 11 09:25 conf.json
-rw-r--r-- 1 root root 3956 Dec 11 09:25 mime.types
不知道问题出在哪,盼回复,谢谢!
[ERROR] 2016/05/22 17:52:58 console.go 122 apibox.club/website.SSHWebSocketHandler [Upgrade WebScoket Error: websocket: origin not allowed]
控制台输入账号密码后,在终端的页面js报错:WebSocket connection to 'ws://192.168.91.128:8080/console/sshws/g7CrqekJ-Q-Jljlgc67hu0zRldZdwi4R2estCxqTKw==?cols=125&rows=64' failed: Error during WebSocket handshake: Unexpected response code: 403,请问这是什么原因照成的呢?
RT
我使用的是默认配置,远端是centos7的docker容器.进去之后, w 能看到client端已经ssh登录进来了.但是页面是一片黑,什么也不显示.是不是有某些默认配置项需要修改呢?
能在readme里说明下配置参数的意义吗?
Hi @shibingli , I want to access all the machines in the LAN through webconsole, how to manage multiple machines through webconsole? Thanks.
All the machines are in a local area network, only one machine can communicate with the outside network. I want to provide the function of Web terminal through this machine. Can this function be implemented through webconsole? Thanks.
如题。
目前这两项对使用还是不太方便。
hi, @shibingli
Can I type in Chinese?
都是一些建议,很不错的项目,我愿意参与,不过前端技术太渣。
不是全屏的时候右边显示不全,往右拉的时候边框不一致。
请教下,我想通过nginx进行连接,webconsole把fcgi设置为true,正常启动,那么nginx中应该怎么设置呢,现在我是可以看到webconsole的初始化界面,但是当我连接其他服务器时,会报500错误,并且日志中没有详细信息,界面报:WebSocket connection to 'ws://192.168.0.11:8081/console/sshws/TMs0RynNtQloNKDBksDp8krEE3-Gj6S3nq4a1tYsxMlK6MrDiRs7inkYUQa4Mw==?cols=149&rows=15' failed: Error during WebSocket handshake: Unexpected response code: 500
nginx中的设置为:
`
server {
listen 8081;
server_name localhost;
location / {
fastcgi_pass 192.168.0.11:8080;
include fastcgi_params;
}
}
`
请问怎么停止 tailf
ctrl+c不起效果
目前发现是的是使用ctrl+z,但是是stopped到后端执行了。 进程没有被杀死
你好,请问一下我用的是v2版本的那个branch,通过docker build的镜像去docker run之后启动是成功的,登录页面也能访问,但是在页面上调用http://10.0.0.151:32771/console/chksshdaddr 接口的时候一直都是404,点击登录按钮调用的http://10.0.0.151:32771/console/login 接口也一直都是404,不是很清楚原因在哪里。
然后通过docker pull了两个版本的镜像分别是shibingli/webconsole:latest和shibingli/webconsole:v2,v2的镜像也是同样的问题,而latest则是发现登录成功了,但是http://10.0.0.151:32772/console/sshws/iTigtW5fH3eaftrV03UfI7wMRH5e-Ve-QGY=?cols=145&rows=9 这个websocket报了403,所以没法操作。conf.json下的cors_white_list也已经添加并重启了容器 仍然是403
Step 4 : RUN cd /go/src/apibox.club/apibox/ && go install -v
---> Running in 3c46820b1ce1
../utils/dbutils.go:5:2: no buildable Go source files in /go/src/github.com/go-sql-driver/mysql
../website/console.go:14:2: no buildable Go source files in /go/src/github.com/gorilla/websocket
../website/console.go:15:2: cannot find package "golang.org/x/crypto/ssh" in any of:
/usr/local/go/src/golang.org/x/crypto/ssh (from $GOROOT)
/go/src/golang.org/x/crypto/ssh (from $GOPATH)
../utils/utils.go:22:2: cannot find package "golang.org/x/text/encoding" in any of:
/usr/local/go/src/golang.org/x/text/encoding (from $GOROOT)
/go/src/golang.org/x/text/encoding (from $GOPATH)
../utils/utils.go:23:2: cannot find package "golang.org/x/text/encoding/japanese" in any of:
/usr/local/go/src/golang.org/x/text/encoding/japanese (from $GOROOT)
/go/src/golang.org/x/text/encoding/japanese (from $GOPATH)
../utils/utils.go:24:2: cannot find package "golang.org/x/text/encoding/korean" in any of:
/usr/local/go/src/golang.org/x/text/encoding/korean (from $GOROOT)
/go/src/golang.org/x/text/encoding/korean (from $GOPATH)
../utils/utils.go:25:2: cannot find package "golang.org/x/text/encoding/simplifiedchinese" in any of:
/usr/local/go/src/golang.org/x/text/encoding/simplifiedchinese (from $GOROOT)
/go/src/golang.org/x/text/encoding/simplifiedchinese (from $GOPATH)
../utils/utils.go:26:2: cannot find package "golang.org/x/text/encoding/traditionalchinese" in any of:
/usr/local/go/src/golang.org/x/text/encoding/traditionalchinese (from $GOROOT)
/go/src/golang.org/x/text/encoding/traditionalchinese (from $GOPATH)
../utils/utils.go:27:2: cannot find package "golang.org/x/text/encoding/unicode" in any of:
/usr/local/go/src/golang.org/x/text/encoding/unicode (from $GOROOT)
/go/src/golang.org/x/text/encoding/unicode (from $GOPATH)
../utils/utils.go:28:2: cannot find package "golang.org/x/text/transform" in any of:
/usr/local/go/src/golang.org/x/text/transform (from $GOROOT)
/go/src/golang.org/x/text/transform (from $GOPATH)
版本最新版,只能通过鼠标滚轮,鼠标不能拖动呢!chrome版本 WIN 62.0.3202.94(正式版本)(64 位) 版本应该还算较新吧。。。
安装完 最新版本, 用go1.9.2安装的,进去黑屏,是因为GO版本吗?
不会go不过在努力学习你的代码
Is there any consideration to support ssh key based login?
console.min.js:1 WebSocket connection to 'ws://10.0.8.122:10010/console/sshws/Lo6JpqA87KrIt1CO8WF0CjGInZYnZ64RmfkK+u5XTQSjF4s=?cols=136&rows=16' failed: Error during WebSocket handshake: Unexpected response code: 403
ssh软件是支持这个功能的,不知道golang的ssh是否支持此功能,如何设置?
clone的是最新的master代码;
remote: Compressing objects: 100% (43/43), done.
remote: Total 19017 (delta 24), reused 35 (delta 18), pack-reused 18955
Receiving objects: 100% (19017/19017), 7.83 MiB | 1.56 MiB/s, done.
Resolving deltas: 100% (13553/13553), done.
Submodule path 'src/golang.org/x/tools': checked out '8b178a93c1f5b5c8f4e36cd6bd64e0d5bf0ee180'
[root@centos7 webconsole]# ls
conf Dockerfile LICENSE README.md src static template
[root@centos7 webconsole]# cd /opt/webconsole/src/apibox.club/apibox
[root@centos7 apibox]# GOPATH=/opt/webconsole go install
../website/console.go:35: undefined: ssh.InsecureIgnoreHostKey
Request URL:ws://XXXXXXXXXXXXXX/console/sshws/4AnM1ZFyEabNmWfmiklO6XqevNea7m7Zsv419uNtt3Ee?cols=125&rows=12
Request Method:GET
Status Code:403 Forbidden
strconv.ParseInt: parsing "": invalid syntax
没有显示命令符
部署完成后web登录没有shell怎么回事?黑屏的,
I use the default 'session_timeout' setting (1800).
In my setup the console closed in a very short period of time. Is the '1800' second?
访问一次后退出后就会报下面的错误,
WebSocket connection to 'ws://xxxxxxxxxxxx?cols=87&rows=39' failed: Could not decode a text frame as UTF-8.
Failed to parse SourceMap: http://xxxxxxxxxxxx/console/main/index.js.map
Failed to get text for stylesheet 3348.21: No style sheet with given id found
在终端里面 为什么 复制粘贴的时候 显示2次?
jsonp跨域提交post请求失败,服务端返回的json对象如下:
{
"ok": true,
"msg": "",
"data": "/console/main/wkpe2VrDtSBXQwrWp8Es8px0ROjhjJh379Wb91WqE6wx"
}
该json对象不能被js处理从而报错“Uncaught SyntaxError: Unexpected token :”,
请问我该怎么处理此类问题?
通过xterm输入中文,例如cat xxx.log|grep "用户未登陆",服务器返回一堆感觉是ls /的东西
{"data":"g"}
{"data":"rep "\u0007\u0007\u0007\u0008\u0008\u0008\u0008\u0008\u0008\u001b[K\r(arg: 1) \u001b[K"}
{"data":"\u0008\u0008\u00087) \r\u001b]0;root@fe38d2d32cb4: /xxx/package\u0007root@fe38d2d32cb4:/xxx/package# \u0007"}
然后控制台都是一些目录名
failed: Error during WebSocket handshake: Unexpected response code: 403
1、下载 go1.8.1.linux-amd64.tar.gz
2、tar zxvf go1.8.1.linux-amd64.tar.gz -C /usr/local
3、echo 'export PATH="/usr/local/go/bin:$PATH"' >> /etc/profile
4、source /etc/profile
这部分是安装go 我现在环境是已经安装了go的,而且也是开发了几个go实例 所以go环境没有问题
5、cd /opt && git clone --recurse-submodules https://github.com/shibingli/webconsole.git && cd webconsole && git submodule update --init --recursive
6、cd /opt/webconsole/src/apibox.club/apibox
7、GOPATH=/opt/webconsole go install
这部分只不过是获取代码 和 更新子模块
后面GOPATH我也是按照我自己的代码路径来的 为啥什么都没有返回 也没有报错 也没有bin目录产生?
还有一个问题 请问程序在开发环境怎么搭建运行?
谢谢 麻烦了 ~
@shibingli
点击右上角的“退出”按钮后,页面可以正常调整到login页面,但目标主机上的ssh连接并没有断开。
多次点击左上角的“刷新”按钮,后台会出现多个ssh连接,之前的都没有断开。
浏览器:chrome,跟浏览器没关系。
OS:Centos7.3
点击退出后,页面退出到login了,但在目标机器通过who命令查看,仍然在登陆状态。
[root@localhost ~]# who
root :0 2018-06-30 18:14 (:0)
root pts/0 2018-06-30 18:14 (:0)
root pts/1 2018-06-30 18:57 (192.168.81.128)
root pts/2 2018-06-30 18:58 (192.168.81.128)
如果多次点击刷新按钮,会产生多个连接。
[root@localhost ~]# netstat -anp | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1049/sshd
tcp 0 0 192.168.81.129:22 192.168.81.128:36604 ESTABLISHED 48775/sshd: root@no
tcp 0 0 192.168.81.129:22 192.168.81.128:36616 ESTABLISHED 48826/sshd: root@no
tcp 0 0 192.168.81.129:22 192.168.81.128:36598 ESTABLISHED 48763/sshd: root@no
tcp6 0 0 :::22 :::* LISTEN 1049/sshd
请问下,logout时未断开连接,是漏掉的逻辑?还是有意为之?(不主动断开连接,而是等待操作系统TMOUT生效,或ssh超时生效?)
root@zxin10-desktop:/opt/gopath/src/github.com/webconsole_demo/webconsole# ./build.sh
==> Golang is already installed.
==> Please run the /opt/gopath/src/github.com/webconsole_demo/webconsole/bin/apibox.
root@zxin10-desktop:/opt/gopath/src/github.com/webconsole_demo/webconsole# ll
total 76
drwxr-xr-x 9 root root 4096 4月 20 01:11 ./
drwxr-xr-x 3 root root 4096 4月 20 01:01 ../
-rwxr-xr-x 1 root root 689 4月 20 01:08 build.sh*
drwxr-xr-x 2 root root 4096 4月 20 01:08 conf/
-rw-r--r-- 1 root root 179 4月 20 01:08 Dockerfile
drwxr-xr-x 9 root root 4096 4月 20 01:08 .git/
-rw-r--r-- 1 root root 261 4月 20 01:08 .gitignore
-rw-r--r-- 1 root root 1065 4月 20 01:08 .gitmodules
-rw-r--r-- 1 root root 10721 4月 20 01:08 LICENSE
drwxr-xr-x 3 root root 4096 4月 20 01:11 pkg/
-rw-r--r-- 1 root root 8599 4月 20 01:08 README.md
drwxr-xr-x 5 root root 4096 4月 20 01:08 src/
drwxr-xr-x 4 root root 4096 4月 20 01:08 static/
drwxr-xr-x 3 root root 4096 4月 20 01:08 template/
drwxr-xr-x 2 root root 4096 4月 20 01:08 .vscode/
希望能给出编译的方法, 没有研究过 Go 的编译方法.
要不很多人都得去研究 Go 的编译才能使用你的东东哦.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.