文章目录[隐藏]
虽然说有不少方便实用的SSH客户端,比如Windows下的Putty、Xshell,安卓上的JuiceSSH,但有时候我想在其他电脑上使用SSH又不想下载安装这些软件时就想要一个网页版的SSH工具。今天终于想到这件事,搜了一下发现还真有,就是这个GateOne,不过这个需要用到Python,下面就说说我安装配置的过程。
一、环境配置
我的系统是Ubuntu16.04,首先要安装Python,Python2或者3都可以。其次就要安装一些依赖文件:
apt-get install python python-pip python-imaging
pip install pyopenssl ordereddict tornado==2.4.1
等待安装完成即可。如果缺少一些依赖文件,GateOne在运行时会提示错误的,亲测
二、下载安装GateOne
GateOne项目的源码在GateOne,下载地址:gateone-1.1.tar.gz,具体的命令:
wget https://github.com/downloads/liftoff/GateOne/gateone-1.1.tar.gz
tar -xzvf gateone-1.1.tar.gz
cd gateone-1.1
也可以用git clone 命令来下载:
git clone https://github.com/liftoff/GateOne.git
cd GateOne
如果没有wget 或者 git 命令,先用 apt-get install git wget 来下载wget 和 git
然后就是安装了,进入到GateOne目录里,输入命令:
python setup.py install
等待完成即可。
三、配置GateOne
安装完成之后先运行一下GateOne:
gateone
或者
service gateone start
这时它会自动生成配置文件,按住 ctrl + C 或者 输入命令
service gateone stop //如果你是用 service gateone start 启动的
停止gateone。它的配置文件一般在 /etc/gateone/conf.d/10server.conf,用一个编辑器打开它,是这样的:
// This is Gate One's main settings file.
{
// "gateone" server-wide settings fall under "*"
"*": {
"gateone": { // These settings apply to all of Gate One
"address": "",
"ca_certs": null,
"cache_dir": "/tmp/gateone_cache",
"certificate": "certificate.pem",
"combine_css": "",
"combine_css_container": "#gateone",
"combine_js": "",
"cookie_secret": "Yjg3YmUzOGUxM2Q2NDg3YWI1MTI1YTU3MzVmZTI3YmUzZ",
"debug": false,
"disable_ssl": false,
"embedded": false,
"enable_unix_socket": false,
"gid": "0",
"https_redirect": false,
"js_init": "",
"keyfile": "keyfile.pem",
"locale": "en_US",
"log_file_max_size": 100000000,
"log_file_num_backups": 10,
"log_file_prefix": "/opt/gateone/logs/webserver.log",
"log_to_stderr": null,
"logging": "info",
"origins": [
"localhost", "127.0.0.1", "enterprise",
"enterprise.example.com", "10.1.1.100"],
"pid_file": "/tmp/gateone.pid",
"port": 443,
"session_dir": "/tmp/gateone",
"session_timeout": "5d",
"syslog_facility": "daemon",
"syslog_host": null,
"uid": "0",
"unix_socket_path": "/tmp/gateone.sock",
"url_prefix": "/",
"user_dir": "/opt/gateone/users",
"user_logs_max_age": "30d"
}
}
}
这里可以看看GateOne的文档,如果你不用https,就要把
"disable_ssl": false,
这一行中的false 改为 true
如果想要把它嵌入到网站之中,就把
"embedded": false, //改为true
至于如何嵌入到网站,随后有时间了再搞,我会再更新的。
还有最重要的端口设置
"port": 443, // 默认是443,如果不用https 就改成其他的端口
至于这个:
"origins": [
"localhost", "127.0.0.1", "enterprise",
"enterprise.example.com", "10.1.1.100"],
在这里面添加域名或者IP,例如上面的端口填的是111,域名添加了sunriseydy.top,就可以在浏览器中访问:sunriseydy.top:111 来使用GateOne。
四、运行GateOne
配置完GateOne后就可以启动GateOne了,如果只是为了测试,就用命令
gateone
来启动,如果想在后台运行,就输入命令
service gateone start
点击那个电脑图标,就打开了命令行:
[Press Shift-F1 for help]
Host/IP or ssh:// URL [localhost]: 192.168.106.139 //输入要连接的SSH地址,默认是localhosts
Port [22]: 2233 //输入SSH的端口,默认是22
User: root //输入要登陆的用户
Connecting to ssh://root@192.168.106.139:2233
The authenticity of host '[192.168.106.139]:2233 ([192.168.106.139]:2233)' can't be established.
ECDSA key fingerprint is SHA256:f1Nqp/itJfpfZL1ntmz+Gn8dPJIDkp/MjUZfXA+WKR0.
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)? yes //第一次登陆该SSH会有提示,输入yes 即可
Warning: Permanently added '[192.168.106.139]:2233' (ECDSA) to the list of known hosts.
root@192.168.106.139's password: //输入用户密码(不可见)
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Last login: Thu Sep 28 16:09:00 2017 from 192.168.106.1
root@ubuntu:~#
好啦,大功告成!
参考链接:
本作品由 sunriseydy 采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
文章内容如未说明均为原创,欢迎转载,但请注明原作者(sunriseydy)和原文链接(https://blog.sunriseydy.top/technology/linux/ubuntu-install-gateone/)
部分来自互联网的文章,如有侵权,请联系我,24小时内删除,谢谢
感谢您的支持,SunriseYDY 会继续努力的!



打开支付宝扫一扫,即可进行扫码打赏哦
日出一点一 | 在探索的路上永不止步