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. fabric 安装及使用

    官网地址 1.安装 pip install fabric 依赖 Paramiko .PyCrypto库 以下依赖肯能要手动安装 #安装 pycrypto 密码库pip install pycrypto ...

  2. Power Strings(kmp妙解)

    Power Strings Time Limit : 6000/3000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Tota ...

  3. EK中fromCharCode和parseInt的配合使用

    基于web的漏洞攻击的第一步一般是:在landing page中通过<script>标签下的JavaScript脚本引入一些恶意链接.这些脚本往往会採用各种各样的混淆.加密手法来躲避AV和 ...

  4. android初级应用到高端架构教程------ 完整体系化学习android开发

    系统的学习android开发技术,从应用到底层,再到架构,告别乱糟糟的学习方式,不再是抓不住重点.从上到下贯通,全面学习android开发.让你拥有清晰的思路,一步步学习android开发! 一般而言 ...

  5. 求链表的倒数第k个节点

    问题描述:给定一个链表的头节点,求出链表的倒数第k个节点. 分析:这是链表里的经典问题,存在多种解法,下面给大家分享下我的想法. 解法一:很直观的一种做法是从头到尾扫描链表,然后求倒数第k个,但是由于 ...

  6. IIS中如何建立FTP服务

    文件传输协议 (FTP) 是一个标准协议,可用来通过 Internet 将文件从一台计算机移到另一台计算机.这些文件存储在运行 FTP 服务器软件的服务器计算机上.然后,远程计算机可以使用 FTP 建 ...

  7. Fiddler 跟踪 手机页面数据包

    随着 HTML5 的急速增长,现在越来越多的人,开始涉及到移动终端的 Web 开发领域,但手机端始终没有 PC 端这么多的调试工具.即使 PC 端浏览器模拟 user-agent 进行开发,也可能会发 ...

  8. (五)认识Android中的Service

    一.使用Service 1.右击java文件夹,选择新建Service,然后重写其中的onStartCommand函数,只要执行了startService函数,onStartCommand便会被执行 ...

  9. Char型和string型字符串比较整理

    1.赋值 char赋值: char ch1[] = "give me"; char ch2[] = "a cup"; strcpy(ch1,ch2); cout ...

  10. Python Challenge

    0. 2的38次方 print 2**38 ##apply the result to the url 1. 看图是要right shift两位, 切片即可. import string intab ...