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. Segment FRAM_DATA must be defined in a segment definition option (-Z, -b or -P)

    1. 网上说这个回答是 协议栈和IAR版本号不一样,这算什么神马问题 2. 网上的解决的方法是改动 options-> link -> config -> 改动里面的连接文件,可是怎 ...

  2. [置顶] ANT build.xml文件详解

    Ant的优点 跨平台性.Ant是用Java语言编写的,所示具有很好的跨平台性. 操作简单.Ant是由一个内置任务和可选任务组成的. Ant运行时需要一个XML文件(构建文件). Ant通过调用targ ...

  3. Android appcompat备案

    使用Eclipse创建Android项目,project多出appcompat_v7,此情况在ADT升级到22.6.x版本后出现,22.3.x前版本不存在.此项为了实现向下兼容sdk的功能. 点击项目 ...

  4. MySQL之终端(Terminal)管理MySQL(转)

    前言:MySQL有很多的可视化管理工具,比如“mysql-workbench”和“sequel-pro-”. 现在我写MySQL的终端命令操作的文章,是想强化一下自己对于MySQL的理解,总会比使用图 ...

  5. 【概率论】【POJ 3682】【King Arthur's Birthday Celebration】

    题意:进行翻硬币实验,若k次向上则结束,进行第n次实验需花费2*n-1的费用,询问期望结束次数及期望结束费用 设F[i]为第i次结束时的概率 F[i]=  c(i-1,k-1)*p^k*(1-p)^( ...

  6. 将 Maven生成的java项目转化为支持 Eclipse IDE的项目

    转自: http://www.xuebuyuan.com/1297046.html 将 Maven生成的java项目转化为支持 Eclipse IDE的项目   在前一篇文章中,我们使用maven创建 ...

  7. https配置

    总结了一下: 所谓用HTTPS的时候 app 前端要配置SSL 证书的意思就是:相当于服务器端与app 前端, 一个拿公钥,一个拿私钥.简单得说就是客户端发送请求的时候,用配置好的SSL证书里的加密方 ...

  8. 前端公共库cdn服务推荐//提高加载速度/节省流量

    前端公共库cdn服务推荐,使用可以提高js库加载速度同时也可以节省自己空间的流量,CDN加速公共库虽好,不过一定要使用靠谱的前端cdn服务提供方. 以下整理出比较靠谱的国内cdn加速服务器.排名不分先 ...

  9. 学习java的视频资源(尚学堂)(比较老旧,但是还是挺好用)

    本人新手,转入IT,一开始在学校的时候看过尚学堂 马士兵讲过的java基础视频教程,这次深入学习呢,就从百度云盘找了一整套的视频资源.之后越深入的学习呢,发现这些视频资源VeryCD上都发布了,地址 ...

  10. 在Linux上使用cmake创建CodeBlocks工程

    最近在linux上使用cmake,对于使用GUI习惯的还真不能适应,真是想尽一切办法把原来使用cmake的工程创建成CodeBlocks工程.工程小了还能接受,工程大了太麻烦了. 看了一下cmake的 ...