开源web终端gateone

GateOne 是一款 使用 HTML5 技术编写的网页版 SSH 终端模拟器 。

· 基于现代的 HTML5 技术, 无需任何浏览器插件 。

· 支持 多个 SSH 进程 。

· 可以嵌入到其他任意应用程序中。

· 支持 使用 JavaScript , Python 甚至纯 CSS 编写的插件 。

· 支持 SSH 进程副本,打开多个进程而无需重复输入密码。

· 支持各种 服务器端的日志功能 ,支持 Keberos-based 单点登录甚至活动目录。

· 支持操作日志记录,具有操作记录回放功能

项目地址 https://github.com/liftoff/GateOne

开发语言 python

当前版本 1.1


wget https://github.com/downloads/liftoff/GateOne/tornado-2.4-1.noarch.rpm

wget https://github.com/downloads/liftoff/GateOne/gateone-1.1-1.noarch.rpm

yum install -y python-ordereddict

rpm -ivh tornado-2.4-1.noarch.rpm

rpm -ivh gateone-1.1-1.noarch.rpm

默认安装在/opt/gateone/目录

cd /opt/gateone/

生成配置文件,并启动
./gateone.py 

[W 150507 11:37:40 terminal:181] Could not import the Python Imaging Library (PIL) so images will not be displayed in the terminal

[I 150507 11:37:40 gateone:2748] /opt/gateone/server.conf not found or missing cookie_secret.  A new one will be generated.

[W 150507 11:37:40 gateone:2893] dtach command not found.  dtach support has been disabled.

[I 150507 11:37:40 gateone:2917] Connections to this server will be allowed from the following origins: ‘http://localhost https://localhost http://127.0.0.1 https://127.0.0.1 https://localhost https://localhost.localdomain https://localhost4 https://localhost4.localdomain4 https://localhost.localdomain https://localhost6 https://localhost6.localdomain6 https://127.0.0.1 https://127.0.0.1‘

[I 150507 11:37:40 gateone:2957] No SSL private key found.  One will be generated.

[I 150507 11:37:41 gateone:2307] No authentication method configured. All users will be ANONYMOUS

[I 150507 11:37:41 gateone:2404] Loaded plugins: bookmarks, convenience, example, help, logging, logging_plugin, mobile, notice, playback, ssh

[I 150507 11:37:41 gateone:3054] Listening on https://*:443/

[I 150507 11:37:41 gateone:3060] Process running with pid 20653

然后使用CRTL+C结束掉。

cp server.conf server.conf.bak

编辑配置文件,注意红色部分,只允许域名访问,如果需要IP地址,再加一个访问地址就可以了。

vi server.conf 

# -*- coding: utf-8 -*- 
locale = "en_US" 
pam_service = "login" 
syslog_facility = "daemon" 
syslog_host = None 
enable_unix_socket = False 
port = 443 
uid = "0" 
url_prefix = "/" 
user_dir = "/opt/gateone/users" 
dtach = True 
certificate = "certificate.pem" 
log_to_stderr = False 
session_logs_max_age = "30d" 
gid = "0" 
pid_file = "/var/run/gateone.pid" 
sso_realm = None 
cookie_secret = "ZmNiNmI3ZDFlMWYzNDkxMmJmYTRkOTNkMzRmODk4ZmVjN" 
pam_realm = "localhost.localdomain" 
sso_service = "HTTP" 
https_redirect = False 
syslog_session_logging = False 
disable_ssl = False 
debug = False 
session_dir = "/tmp/gateone" 
auth = "none" 
address = "" 
api_timestamp_window = "30s" 
log_file_num_backups = 10 
logging = "info" 
embedded = False 
origins = "https://admin.xx.com" 
session_logging = True 
unix_socket_path = "/var/run/gateone.sock" 
ssl_auth = "none" 
log_file_max_size = 104857600 
session_timeout = "5d" 
command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py -S ‘/tmp/gateone/%SES                                                                                                                     SION%/%SHORT_SOCKET%‘ --sshfp -a ‘-oUserKnownHostsFile=%USERDIR%/%USER%/ssh/know                                                                                                                     n_hosts‘" 
ca_certs = None 
js_init = "" 
keyfile = "keyfile.pem" 
log_file_prefix = "/opt/gateone/logs/webserver.log" 


以后台方式启动

/etc/init.d/gateone start

访问网页

https://admin.xx.com

技术分享

提示输入IP地址,因为我是访问本机,所以直接回车了。如果是别的主机,可以输入IP地址

输入用户名和密码就可以登录了。

之后就可以操作Linux了。


为了不让别人知道这是一个web ssh工具,做了一个登录页面,验证成功之后,调整到页面https://admin.xx.com

技术分享


本文出自 “陨落星空” 博客,请务必保留此出处http://xiao987334176.blog.51cto.com/2202382/1643794

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。