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. R中执行if else报错:unexpected 'else' in "else"

    注意if else的结构写法,有以下三种,除此之外,会不识别else. 结构  1 :  if()  xx  else    yy   # 一行:结构  2:  if()  {xx} else  {y ...

  2. gitblit-1.8.0域认证

    gitblit-1.8.0\data\defaults.properties # # DEFAULTS.PROPERTIES # # The default Gitblit settings. # # ...

  3. SQL基础语法的单表操作 select|insert|update|delete(增删改查) 简单使用

    以下案列以此表举例 1.select(查询) select简单的查询分为两种 注:字段也就是表结构中的列的名称 第一种: select  字段名  from  表名 此种查询只列出你所需要查询的字段, ...

  4. PhpStorm 回到上次编辑位置的快捷键

    回到上次编辑位置 Ctrl + Alt + <- (向后) Ctrl + Alt + -> (向前) 这个快捷键有时和电脑桌面快捷键冲突.解决办法: win + D 回到电脑桌面,右键-& ...

  5. php判断是否为时间戳

       判断值是否为时间戳 function is_timestamp($timestamp) { if(strtotime(date('m-d-Y H:i:s',$timestamp)) === $t ...

  6. RNA-seq简单处理流程

    RNA_seq pipline RNA_seq pipline PeRl 2018年3月7日 首先说明一下我做RNA-seq处理流程的文件树格式: RNA-seq/ data/ GRCh38.gtf ...

  7. http://browniefed.com/blog/2015/09/10/the-shapes-of-react-native/

    http://browniefed.com/blog/2015/09/10/the-shapes-of-react-native/

  8. shiro配置说明

    Shiro主要是通过URL过滤来进行安全管理,这里的配置便是指定具体授权规则定义. Xml代码   <bean id="shiroFilter" class="or ...

  9. python基础学习1-装饰器在登陆模块应用

    LOGIN_USER ={"islogin":False} def outer(func): def inner(*args,**kwargs): if LOGIN_USER[&q ...

  10. 【转载】注释AFX_MSG_MAP,AFX_DATA,AFX_DATA_MAP , Afx_MSG等宏不能删除

    原文: BEGIN_MESSAGE_MAP(CMy1Dlg, CDialog) //{{AFX_MSG_MAP(CMy1Dlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON ...