Shellinabox 是一个基于 web 的终端模拟器,通过它在 Web 浏览器登录并访问 Linux 命令行。
下载并编译 shellinabox
# Clone shellinabox from github
$ git clone https://github.com/shellinabox/shellinabox.git
$ cd shellinabox
# Generate configure
$ autoreconf -i
# Compile
$ ./configure && make
# Check
$ ./shellinabxd --version
ShellInABox version 2.20 (revision e6c25e8)
|
运行并测试
运行 shellinaboxd
$ ./make-chained-cert.sh > certificate.pem
$ ./shellinaboxd --service /:user:group:HOME:LOGIN
|
添加自定义 style
创建 custom.scss 样式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| $background: #000; $foreground: #fff;
body { background-color: $background; color: $foreground; }
#vt100 .ansiDef { color: $foreground; } #vt100 .ansiDefR { color: $background; } #vt100 #scrollable.inverted .ansiDef { color: $background; } #vt100 #scrollable.inverted .ansiDefR { color: $foreground; }
#vt100 .bgAnsiDef { background-color: $background; } #vt100 .bgAnsiDefR { background-color: $foreground; } #vt100 #scrollable.inverted .bgAnsiDef { background-color: $foreground; } #vt100 #scrollable.inverted .bgAnsiDefR { background-color: $background; }
#vt100 #cursor.bright { background-color: whitesmoke; color: black; }
|
编译 sass 文件
$ sudo gem install sass
$ sass custom.scss > custom.css
|
运行并测试自定义样式
运行 shellinaboxd
$ ./shellinaboxd --service /:user:group:HOME:LOGIN --css=custom.css
|