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. 新闻公布系统 (Asp.net 三层架构 )

    2012年度课程设计---新闻公布系统(小结)                                                                             ...

  2. Appium的前世今生

    Appium的前世今生 一.什么是Appium Appium是一个开源.跨平台的测试框架,可以用来测试原生及混合的移动端应用.Appium支持IOS.Android及FirefoxOS平台.Appiu ...

  3. 获得android应用的版本号

    在开发的过程中,需要获得版本号 private PackageInfo getVersion() { PackageManager packageManager = MyApplication.get ...

  4. 想使用WM_CONCAT 函数进行多列转一行,但发现没有

    查看数据库版本: SELECT * FROM v$version; 1 Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bi ...

  5. 私有构造函数(c# .NET)

    如果类成员有private修饰符,就不允许在类范围以外访问这个类成员.对类构造函数应用private修饰符时,则禁止外部类创建该类的实例.尽管看上去有些不好理解(既然不能实例化,那么这个类还有什么用处 ...

  6. Spring-----自定义属性编辑器

    转载自:http://blog.csdn.net/hekewangzi/article/details/51712963

  7. Handle 消息机制

    android中Handle类的主要作用: 1.在新启动的线程中发送给消息 2.在主线程获取.处理消息 为什么要用Handle这样的一个机制: 因为在Android系统中UI操作并不是线程安全的,如果 ...

  8. MFC常用 控制对话框透明属性函数

    void CFloatWnd::OnUpdateTransparent(int iTransparent){ HINSTANCE hInst = LoadLibrary("User32.DL ...

  9. ecshop使用Google API及OAuth2.0登录授权(PHP)

    一.申请clientID https://console.developers.google.com/project 二.开启Google+ API权限 https://console.develop ...

  10. python 初学笔记 (一)

    初学python第一天,希望自己真正了解计算机语言,并且做出成效. 写下学习笔记,记录学习进度,娱乐学习,不断成长. python详细介绍: python是什么?运用到哪里?有哪些在使用它? pyth ...