wssh 是一个 SSH 到 WebSockets 的桥,可以让你通过 HTTP 调用远程服务器的 SHELL 命令。
wssh 可以让我们通过 HTTP 来调用远程的一个 shell,也就是说我们可以用浏览器来访问某个 Linux 服务器/虚拟机的终端(只要这个服务器上运行了 wsshd 服务器端)。wssh 客户端通过 ssh 帐号连接到 wsshd 服务器端。wssh 更多的是当作库来开发一些应用,比如开发云计算、虚拟机后台控制面板的虚拟机控制台等等。

下载并安装wssh:

$ git clone https://github.com/aluzzardi/wssh.git
$ cd wssh
$ sudo python setup.py install

启动:

[root@localhost ~]# wsshd
wsshd/0.1. running on 0.0.0.0:

上述是官方getHub上提供的基本安装启动方式。不过一般安装过程中多会出现很多问题,本人仅将安装过程中遇到的问题与解决方案在下文详细列出贡给位参考:

一、必备的安装软件

主要有:gcc python libevent-dev python-dev python-pip

安装方法:sudo yun install git gcc python libevent-dev python-dev

  python-pip安装方式:

  首先要安装 Setuptools

wget --no-check-certificate https://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
sudo sh ./setuptools-.6c11-py2..egg

      安装PIP

wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz
tar -zxvf ./pip-1.4.tar.gz
cd pip-1.4
sudo python setup.py install

二、安装wssh需要的各种Python库

主要有:gevent gevent-websocket paramiko flask

sudo pip install gevent gevent-websocket paramiko flask

按照上述步骤执行好之后,我们可以安装wssh,

Traceback (most recent call last):
File "/usr/bin/wsshd", line , in <module>
pkg_resources.run_script('wssh==0.1.0', 'wsshd')
File "/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line , in run_script
if insert:
File "/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line , in run_script File "/usr/lib/python2.6/site-packages/wssh-0.1.0-py2.6.egg/EGG-INFO/scripts/wsshd", line , in <module>
import argparse
ImportError: No module named argparse ##提示我们缺少argparse

接下来我们就按照提示安装确实的argparse:

######### 安装缺失的包 #########
[root@cloud003 wssh]# sudo pip install argparse
Downloading/unpacking argparse
You are installing an externally hosted file. Future versions of pip will default to disallowing externally hosted files.
Downloading argparse-1.2..tar.gz (69kB): 69kB downloaded
Running setup.py egg_info for package argparse
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Installing collected packages: argparse
Running setup.py install for argparse
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Successfully installed argparse
Cleaning up...
########## 再次启动wsshd,还会有错吗? ##################
[root@cloud003 wssh]# wsshd
Traceback (most recent call last):
File "/usr/bin/wsshd", line , in <module>
pkg_resources.run_script('wssh==0.1.0', 'wsshd')
File "/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line , in run_script
if insert:
File "/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line , in run_script File "/usr/lib/python2.6/site-packages/wssh-0.1.0-py2.6.egg/EGG-INFO/scripts/wsshd", line , in <module>
from geventwebsocket import WebSocketHandler
ImportError: cannot import name WebSocketHandler

上述错误说明在65行有问题,解决方案如下:

[root@cloud003 wssh]# vi /usr/lib/python2./site-packages/wssh-0.1.-py2..egg/EGG-INFO/scripts/wsshd
#######修改第65行为:from geventwebsocket.handler import WebSocketHandler ########
[root@cloud003 wssh]# wsshd ####成功启动
wsshd/0.1. running on 0.0.0.0:
--------------------------------------------------------------------------------
DEBUG in wsshd [/usr/lib/python2./site-packages/wssh-0.1.-py2..egg/EGG-INFO/scripts/wsshd:]:

[Web远程wsshd]CentOS6.4搭建配置wssh的更多相关文章

  1. Centos6.5搭建vsftpd,并配置用户和密码登录

    Centos6.5搭建vsftpd,并配置用户和密码登录 2017年05月11日 18:40:47 阅读数:6142 1)安装vsftpd yum install vsftpd 2)配置vsftpd配 ...

  2. 开源知识库管理系统选型 centos6.4 搭建knowlededgeroot-1.0.4知识库平台

    开源知识库管理系统选型,除了使用wiki外,还有下面可选: http://www.knowledgebase-script.com/ https://github.com/lordlamer/know ...

  3. CentOS6.6搭建LNMP环境

    CentOS6.6搭建LNMP环境 1.设置yum源,本地安装依赖包 1 yum -y install gcc gcc-c++ automake autoconf libtool make 2.下载依 ...

  4. Spring Cloud 入门教程 - 搭建配置中心服务

    简介 Spring Cloud 提供了一个部署微服务的平台,包括了微服务中常见的组件:配置中心服务, API网关,断路器,服务注册与发现,分布式追溯,OAuth2,消费者驱动合约等.我们不必先知道每个 ...

  5. 结合jquery的前后端加密解密 适用于WebApi的SQL注入过滤器 Web.config中customErrors异常信息配置 ife2018 零基础学院 day 4 ife2018 零基础学院 day 3 ife 零基础学院 day 2 ife 零基础学院 day 1 - 我为什么想学前端

    在一个正常的项目中,登录注册的密码是密文传输到后台服务端的,也就是说,首先前端js对密码做处理,随后再传递到服务端,服务端解密再加密传出到数据库里面.Dotnet已经提供了RSA算法的加解密类库,我们 ...

  6. 64bit Centos6.4搭建hadoop-2.5.1

    64bit Centos6.4搭建hadoop-2.5.1 1.分布式环境搭建 採用4台安装Linux环境的机器来构建一个小规模的分布式集群. 当中有一台机器是Master节点,即名称节点,另外三台是 ...

  7. Centos6一键搭建L2TP VPN服务器

    用VPS在墙上打洞还有一种叫L2TP,也是常见的一种方式.本脚本结合了L2TP(Layer Tunneling Protocol)和IPSec(Internet Protocol Security), ...

  8. Samba服务器搭建配置

    本次环境: 服务端-centos6.8-192.168.2.200 客户端1-centos6.8-192.168.2.201 客户端2-Windows7-192.168.2.104 假设条件如下: 使 ...

  9. Web API 实现JSONP或者安装配置Cors跨域

    前言 照理来说本节也应该讲Web API原理,目前已经探讨完了比较底层的Web API消息处理管道以及Web Host寄宿管道,接下来应该要触及控制器.Action方法,以及过滤器.模型绑定等等,想想 ...

随机推荐

  1. 各种浏览器兼容篡位的css样式写法

    谷歌浏览器的识别 @media screen and (-webkit-min-device-pixel-ratio:0) { height:10px; } IE6特制识别的 *HTML .Searc ...

  2. 奇妙的算法之LCS妙解

    LCS算法妙解 LCS问题简述:最长公共子序列 一个数列 S,如果分别是两个或多个已知数列的子序列,且是所有符合此条件序列中最长的,则S 称为已知序列的最长公共子序列. LCS问题的分支:最长公共子串 ...

  3. DevExpress GridControl一些属性使用方法总结

    一.如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 二.如何新增一条记录 (1).gridView.AddN ...

  4. asp.net mvc ajax提交例子

    @{ Layout = null; } <script src="../../Scripts/jquery-1.10.2.min.js" type="text/ja ...

  5. android代码集锦

    调用root权限的应用: /** * 执行Command命令的函数 * * @param command 命令 * @return 执行结果 */ public static boolean runR ...

  6. div+css中常见的浏览器兼容性处理-兼容不同浏览器

    在网站设计的时候,应该注意css样式兼容不同浏览器问题,特别是对完全使用DIV CSS设计的网,就应该更注意IE6 IE7 FF对CSS样式的兼容,不然,你的网乱可能出去不想出现的效果! div+cs ...

  7. ASP.NET版本的Kindeditor插件的使用

    1.先从官网中现在最新版本的Kindeditor,官网地址:http://www.kindsoft.net/ 下载之后的目录结构如下:

  8. 解决Qt中QTableWidget类方法setItem 时导致程序崩溃问题

    在为一个音乐播放器增加功能时莫明奇妙的出现程序崩溃,定位到是由于QTableWidget 的setItem方法导致的,最终在此处找到了解决方式. 大致是说不能在setItem之前连接cellChang ...

  9. BZOJ 2780: [Spoj]8093 Sevenk Love Oimaster( 后缀数组 + 二分 + RMQ + 树状数组 )

    全部串起来做SA, 在按字典序排序的后缀中, 包含每个询问串必定是1段连续的区间, 对每个询问串s二分+RMQ求出包含s的区间. 然后就是求区间的不同的数的个数(经典问题), sort queries ...

  10. DOS 根据用户输入执行指令判断IF

    @echo off set /p op="输入指令:" if "%op%" == "1" ( echo 你输入了指令1 ) if " ...