Shellinabox 是一个利用 Ajax 技术构建的基于 Web 的远程Terminal 模拟器,也就是说安装了该软件之后,不需要开启 ssh服务,通过 Web 网页就可以对远程主机进行维护操作了,出于安全考虑, Shellinabox 默认强制使用了https协议,这是个挺有趣的技术,因而就在rhel6上面折腾了下,下面记录了主要的操作步骤

一:编译安装Shellinabox
[root@rhel6 ~]# cd /usr/local/src/tarbag/
[root@rhel6 tarbag]# wgethttp://shellinabox.googlecode.com/files/shellinabox-2.10.tar.gz
[root@rhel6 tarbag]# tar -zxvf shellinabox-2.10.tar.gz -C ../software/
[root@rhel6 tarbag]# cd ../software/shellinabox-2.10/
[root@rhel6 shellinabox-2.10]# ./configure --prefix=/usr/local/shellinabox
[root@rhel6 shellinabox-2.10]# make && make install

或源码安装:https://github.com/shellinabox/shellinabox

二:试启动Shellinabox,可以加上--help参数查看启动选项,这里可以看到默认Shellinabox采用https方式启动
[root@rhel6 ~]# /usr/local/shellinabox/bin/shellinaboxd
Cannot read valid certificate from "certificate.pem". Check file permissions and file format.

[root@rhel6 ~]# /usr/local/shellinabox/bin/shellinaboxd -b -t  //-b选项代表在后台启动,-t选项表示不使用https方式启动,默认以nobody用户身份,监听TCP4200端口

[root@rhel6 ~]# netstat -ntpl |grep shell
tcp        0      0 0.0.0.0:4200                0.0.0.0:*                   LISTEN      16823/shellinaboxd

[root@rhel6 ~]# killall  shellinaboxd

三:生成pem证书,以https方式启动,pem证书的格式为公钥加私钥,并以x509的格式进行打包
[root@rhel6 ~]# openssl genrsa -des3 -out my.key 1024  
[root@rhel6 ~]# openssl req -new -key my.key  -out my.csr
[root@rhel6 ~]# cp my.key my.key.org
[root@rhel6 ~]# openssl rsa -in my.key.org -out my.key
[root@rhel6 ~]# openssl x509 -req -days 3650 -in my.csr -signkey my.key -out my.crt
[root@rhel6 ~]# cat my.crt my.key > certificate.pem

[root@rhel6 ~]# /usr/local/shellinabox/bin/shellinaboxd -c /root -u root -b  //-c参数指定pem证书目录,默认证书名为certificate.pem,-u 选项指定启动的用户身份
[root@rhel6 ~]# netstat -ntpl |grep 4200
tcp        0      0 0.0.0.0:4200                0.0.0.0:*                   LISTEN      26445/shellinaboxd

[root@rhel6 ~]# ps -ef |grep shell
root     26445     1  0 14:03 ?        00:00:00 /usr/local/shellinabox/bin/shellinaboxd -c /root -u root -b
root     26446 26445  0 14:03 ?        00:00:00 /usr/local/shellinabox/bin/shellinaboxd -c /root -u root -b

转自:

https://www.linuxidc.com/Linux/2011-01/31678.htm

随手记录-linux-Shellinabox插件的更多相关文章

  1. 通过登入IP记录Linux所有用户登录所操作的日志

    通过登入IP记录Linux所有用户登录所操作的日志 对于Linux用户操作记录一般通过命令history来查看历史记录,但是如果在由于误操作而删除了重要的数据的情况下,history命令就不会有什么作 ...

  2. 记录Linux下安装elasticSearch时遇到的一些错误

    记录Linux下安装elasticSearch时遇到的一些错误 http://blog.sina.com.cn/s/blog_c90ce4e001032f7w.html (2016-11-02 22: ...

  3. 手贱随手在Linux敲了 as 命令,出不来了

    手贱随手在Linux敲了  as  命令,出不了命令,问问度娘吧,得到下列资料 as命令 GNU组织推出的一款汇编语言编译器,它支持多种不同类型的处理器.语法as(选项)(参数)选项-ac:忽略失败条 ...

  4. 记录linux tty的一次软锁排查2

    在复现tty的死锁问题的时候,文洋兄使用了如下的方式: #include <fcntl.h> #include <unistd.h> #include <stdio.h& ...

  5. 如何记录linux终端下的操作日志

    如何记录linux终端下的操作日志 在linux终端下,为方便检查操作中可能出现的错误,以及避免屏幕滚屏的限制,我们可以把操作日志记录下来.常用的工具有 screen,script,以及tee等,通过 ...

  6. Sublime使用记录之SublimeServer插件介绍

    Sublime使用记录之SublimeServer插件介绍 介绍:sublimeServer

  7. 记录linux系统下所有用户的操作信息

    在日常运维中,我们需要清楚服务器上每个用户登录后都做了哪些操作,我们需要记录下每个用户的操作命令.下面的内容设置可以实现在Linux下所有用户,不管是远程还是本地登陆,在本机的所有操作都会记录下来,并 ...

  8. Smart210学习记录-------linux内核模块

    Linux 驱动工程师需要牢固地掌握 Linux 内核的编译方法以为嵌入式系统构建可运行的Linux 操作系统映像.在编译 LDD6410 的内核时,需要配置内核,可以使用下面命令中的 一个: #ma ...

  9. 记录linux 命令

    1.du:查询文件或文件夹的磁盘使用空间 如果当前目录下文件和文件夹很多,使用不带参数du的命令,可以循环列出所有文件和文件夹所使用的空间.这对查看究竟是那个地方过大是不利的,所以得指定深入目录的层数 ...

随机推荐

  1. mysql安装后找不到sock文件

    mysql rpm安装方式之后,启动找不到sock文件,经排查是之前安装的由mysql, 需要时yum list installed mysql 或者  rpm -qa |grep -i mysql ...

  2. servlet使用

    一.使用IDEAL创建项目 1) 2) 3) 4) 5) 6) 7) 8) 9) 二.路径介绍: 配置文件: servlet配置文件: package ser_Test; import javax.s ...

  3. PAT乙级1012

    1012 数字分类 (20 分)   给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: A​1​​ = 能被 5 整除的数字中所有偶数的和: A​2​​ = 将被 5 除后余 1 的 ...

  4. block本质探寻三之block类型

    一.oc代码 提示:看本文章之前,最好按顺序来看: //代码 void test1() { ; void(^block1)(void) = ^{ NSLog(@"block1----&quo ...

  5. Mschart的Annotations属性使用

    近期项目中用到了SPC统计功能,以前是用GDI+绘制的图表,由于坐标计算不准确,显示有偏差,于是重构了代码,将算法与图表做了分离.图表部分如果需要WPF的实现,可以参考以下两个开源项目. https: ...

  6. springMVC第一天——入门、整合与参数绑定

    大纲摘要: 1.Springmvc介绍 2.入门程序 3.Springmvc架构讲解 a) 框架结构 b) 组件说明 4.Springmvc整合mybatis 5.参数绑定 乱码问题解决 a) Spr ...

  7. jQuery学习-基本选择器

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  8. 【转载】Free Lunch is Over(免费午餐已经结束了)

    原文:Free Lunch is Over(免费午餐已经结束了) 微软C++大师Herb Sutter的文章<The Free Lunch Is Over>翻译,以前自己也经常翻译,但是都 ...

  9. 06 django的用户认证组件

    1.用户认证组件 用户认证组件: 功能:用session记录登录验证状态 前提:用户表:django自带的auth_user 创建超级用户: python3 manage.py createsuper ...

  10. 13 - stark总结、github代码

    1.stark - 总结 (单例,继承,反射,面向对象,modelform 应用得很好!!) 1.注册表 单例模式 site = StarkSite() 2.生成url url(r'^stark/', ...