web ssh

web ssh 测试

1、shellinabox安装

wget http://shellinabox.googlecode.com/files/shellinabox-2.10.tar.gz
tar -zxvf shellinabox-2.10.tar.gz
cd shellinabox-2.10
./configure --prefix=/usr/local/shellinabox
make && make install

  2、shellinabox试启动

/usr/local/shellinabox/bin/shellinaboxd
/usr/local/shellinabox/bin/shellinaboxd -b -t
#-b选项代表在后台启动,-t选项表示不使用https方式启动,默认以nobody用户身份,监听TCP4200端口
netstat -ntpl |grep shell
#查看shellinabox启用的端口
killall  shellinaboxd
#结束进程

  3、生成pem证书,以https方式启动,pem证书的格式为公钥加私钥,并以x509的格式进行打包

openssl genrsa -des3 -out my.key 1024
#这条命令运行后需要输入大量信息
openssl req -new -key my.key  -out my.csr
cp my.key my.key.org
openssl rsa -in my.key.org -out my.key
openssl x509 -req -days 3650 -in my.csr -signkey my.key -out my.crt
cat my.crt my.key > certificate.pem
/usr/local/shellinabox/bin/shellinaboxd -c /root -u root -b
#-c参数指定pem证书目录,默认证书名为certificate.pem,-u 选项指定启动的用户身份
netstat -ntpl |grep 4200
ps -ef |grep shell

 https://192.168.0.99:4200
原文地址:https://www.cnblogs.com/syother/p/6732783.html