修改README
This commit is contained in:
parent
b0891a7c38
commit
f69417fe9a
78
README.md
78
README.md
@ -26,7 +26,7 @@ Next Terminal基于 [Apache Guacamole](https://guacamole.apache.org/) 开发,
|
||||
|
||||
## 在线体验
|
||||
|
||||
https://next-terminal.typesafe.cn/
|
||||
https://next.typesafe.cn/
|
||||
|
||||
test/test
|
||||
|
||||
@ -36,17 +36,81 @@ test/test
|
||||
|
||||
## 快速安装
|
||||
|
||||
> 本项目未进行严格的安全性测试,不建议部署安装在公网环境。
|
||||
|
||||
- [使用docker安装](docs/install-docker.md)
|
||||
- [原生安装](docs/install-naive.md)
|
||||
- [FAQ](docs/faq.md)
|
||||
- [安装文档](https://next-terminal.typesafe.cn/document/)
|
||||
|
||||
默认账号密码为 admin/admin
|
||||
|
||||
## 相关截图
|
||||
|
||||
[截图](docs/screenshot.md)
|
||||
### 资源占用
|
||||
|
||||
未使用时资源占用非常小
|
||||
|
||||

|
||||
|
||||
### 控制面板
|
||||
|
||||
更方便的概览系统信息
|
||||
|
||||

|
||||
|
||||
### 资产管理
|
||||
|
||||
支持多种RDP、SSH、Telnet、VNC,Kubernetes等多种协议的资产
|
||||
|
||||

|
||||
|
||||
#### rdp
|
||||
|
||||

|
||||
|
||||
#### vnc
|
||||
|
||||

|
||||
|
||||
#### ssh
|
||||
|
||||

|
||||
|
||||
### 授权凭证
|
||||
|
||||
极为方便的复用资产认证信息
|
||||
|
||||

|
||||
|
||||
批量执行命令
|
||||
|
||||

|
||||
|
||||
### 在线监控
|
||||
|
||||
实时监控用户的操作,并可以随时断开该会话
|
||||
|
||||

|
||||
|
||||
### 离线回放
|
||||
|
||||
详细的数据回放,定位任何一个可疑操作
|
||||
|
||||

|
||||
|
||||
### 计划任务
|
||||
|
||||
自定义计划任务
|
||||
|
||||

|
||||
|
||||
### 访问安全
|
||||
|
||||
黑白名单访问控制,支持ip、cidr及连续IP
|
||||
|
||||

|
||||
|
||||
### 用户组授权
|
||||
|
||||
灵活的授权策略
|
||||
|
||||

|
||||
|
||||
## 联系方式
|
||||
|
||||
|
155
docs/faq.md
155
docs/faq.md
@ -1,155 +0,0 @@
|
||||
# 常见问题
|
||||
|
||||
<details>
|
||||
<summary>如何进行反向代理?</summary>
|
||||
|
||||
主要是反向代理websocket,示例如下
|
||||
```shell
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8088/;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
}
|
||||
|
||||
```
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>访问realvnc提示验证失败?</summary>
|
||||
|
||||
1. 把密码类型修改为VNC
|
||||
2. 把加密类型修改为 Prefer On
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
<summary>docker安装如何更新?</summary>
|
||||
|
||||
推荐使用`watchtower`自动更新
|
||||
|
||||
手动更新需要先拉取最新的镜像
|
||||
|
||||
```shell
|
||||
docker pull dushixiang/next-terminal:latest
|
||||
```
|
||||
|
||||
删除掉原来的容器
|
||||
> 如果是使用sqlite方式启动的,记得备份`next-terminal.db`文件哦
|
||||
```shell
|
||||
docker rm <container-id> -f
|
||||
```
|
||||
再重新执行一次 [docker方式安装命令](install-docker.md)
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>连接rdp协议的windows7或者windows server 2008直接断开?</summary>
|
||||
|
||||
因为freerdp的一个问题导致的,把 设置>RDP 下面的禁用字形缓存打开即可。
|
||||
详情可参考 https://issues.apache.org/jira/browse/GUACAMOLE-1191
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>ssh协议中文字体乱码怎么办?</summary>
|
||||
|
||||
参考[安装字体](install-naive.md)章节,给系统安装中文字体。
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>ssh协议类型的资产连接模式有什么区别?</summary>
|
||||
|
||||
1. 默认:默认使用guacd模式
|
||||
2. 原生:使用golang+xterm.js方式实现的webssh,传输协议是文本,操作响应更快。但目前尚未实现实时监控。
|
||||
3. guacd:Apache Guacamole包装了一层的ssh协议,支持实时监控,录屏播放更加统一。但某些密钥不支持。
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>系统密码忘记了怎么办?</summary>
|
||||
首先需要进入程序所在目录,使用docker安装的程序目录为:/usr/local/next-terminal
|
||||
|
||||
执行命令
|
||||
|
||||
```shell
|
||||
./next-terminal --reset-password admin
|
||||
```
|
||||
|
||||
其中 admin 为用户登录账号,成功之后会输出
|
||||
|
||||
``` shell
|
||||
|
||||
_______ __ ___________ .__ .__
|
||||
\ \ ____ ___ ____/ |_ \__ ___/__________ _____ |__| ____ _____ | |
|
||||
/ | \_/ __ \\ \/ /\ __\ | |_/ __ \_ __ \/ \| |/ \\__ \ | |
|
||||
/ | \ ___/ > < | | | |\ ___/| | \/ Y Y \ | | \/ __ \| |__
|
||||
\____|__ /\___ >__/\_ \ |__| |____| \___ >__| |__|_| /__|___| (____ /____/
|
||||
\/ \/ \/ \/ \/ \/ \/ v0.3.0
|
||||
|
||||
当前数据库模式为:mysql
|
||||
Mar 5 20:00:16.923 [DEBU] 用户「admin」密码初始化为: next-terminal
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>TOTP客户端丢了怎么办?</summary>
|
||||
首先需要进入程序所在目录,使用docker安装的程序目录为:/usr/local/next-terminal
|
||||
|
||||
执行命令
|
||||
|
||||
```shell
|
||||
./next-terminal --reset-totp admin
|
||||
```
|
||||
|
||||
其中 admin 为用户登录账号,成功之后会输出
|
||||
|
||||
``` shell
|
||||
|
||||
_______ __ ___________ .__ .__
|
||||
\ \ ____ ___ ____/ |_ \__ ___/__________ _____ |__| ____ _____ | |
|
||||
/ | \_/ __ \\ \/ /\ __\ | |_/ __ \_ __ \/ \| |/ \\__ \ | |
|
||||
/ | \ ___/ > < | | | |\ ___/| | \/ Y Y \ | | \/ __ \| |__
|
||||
\____|__ /\___ >__/\_ \ |__| |____| \___ >__| |__|_| /__|___| (____ /____/
|
||||
\/ \/ \/ \/ \/ \/ \/ v0.4.0
|
||||
|
||||
当前数据库模式为:mysql
|
||||
Mar 5 20:00:16.923 [DEBU] 用户「admin」已重置TOTP
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>想要修改数据库敏感信息加密的key怎么办?</summary>
|
||||
首先需要进入程序所在目录,使用docker安装的程序目录为:/usr/local/next-terminal
|
||||
|
||||
执行命令
|
||||
|
||||
```shell
|
||||
./next-terminal --encryption-key 旧的加密key --new-encryption-key 新的的加密key
|
||||
```
|
||||
|
||||
成功之后会输出
|
||||
|
||||
``` shell
|
||||
|
||||
_______ __ ___________ .__ .__
|
||||
\ \ ____ ___ ____/ |_ \__ ___/__________ _____ |__| ____ _____ | |
|
||||
/ | \_/ __ \\ \/ /\ __\ | |_/ __ \_ __ \/ \| |/ \\__ \ | |
|
||||
/ | \ ___/ > < | | | |\ ___/| | \/ Y Y \ | | \/ __ \| |__
|
||||
\____|__ /\___ >__/\_ \ |__| |____| \___ >__| |__|_| /__|___| (____ /____/
|
||||
\/ \/ \/ \/ \/ \/ \/ v0.4.0
|
||||
|
||||
当前数据库模式为:mysql
|
||||
Mar 5 20:00:16.923 [DEBU] encryption key has being changed.
|
||||
|
||||
```
|
||||
|
||||
最后重新启动程序,并且把加密key修改为新的。
|
||||
</details>
|
||||
|
@ -1,117 +0,0 @@
|
||||
# docker安装
|
||||
|
||||
默认使用`docker hub`源,与Github的docker镜像仓库`ghcr.io`同步。
|
||||
|
||||
国内用户可以使用阿里云镜像仓库 `registry.cn-qingdao.aliyuncs.com/dushixiang/next-terminal`。
|
||||
|
||||
### 使用`sqlite`存储数据
|
||||
|
||||
最简安装
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
-p 8088:8088 \
|
||||
--name next-terminal \
|
||||
--restart always dushixiang/next-terminal:latest
|
||||
```
|
||||
|
||||
将`sqlite`数据库文件及存储的录屏文件映射到宿主机器
|
||||
|
||||
```shell
|
||||
mkdir -p "/opt/next-terminal/drive"
|
||||
mkdir -p "/opt/next-terminal/recording"
|
||||
touch /opt/next-terminal/next-terminal.db
|
||||
|
||||
docker run -d \
|
||||
-p 8088:8088 \
|
||||
-v /opt/next-terminal/drive:/usr/local/next-terminal/drive \
|
||||
-v /opt/next-terminal/recording:/usr/local/next-terminal/recording \
|
||||
-v /opt/next-terminal/next-terminal.db:/usr/local/next-terminal/next-terminal.db \
|
||||
--name next-terminal \
|
||||
--restart always dushixiang/next-terminal:latest
|
||||
```
|
||||
|
||||
### 使用`mysql`存储数据
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
-p 8088:8088 \
|
||||
-e DB=mysql \
|
||||
-e MYSQL_HOSTNAME=172.1.0.1 \
|
||||
-e MYSQL_PORT=3306 \
|
||||
-e MYSQL_USERNAME=root \
|
||||
-e MYSQL_PASSWORD=mysql \
|
||||
-e MYSQL_DATABASE=next_terminal \
|
||||
--name next-terminal \
|
||||
--restart always dushixiang/next-terminal:latest
|
||||
```
|
||||
|
||||
或者使用docker-compose构建
|
||||
|
||||
示例:
|
||||
|
||||
1. 在root目录下创建文件夹 `next-terminal`
|
||||
2. 在`/root/next-terminal`文件夹下创建`docker-compose.yml`文件
|
||||
|
||||
```yaml
|
||||
version: '3.3'
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0
|
||||
environment:
|
||||
MYSQL_DATABASE: next-terminal
|
||||
MYSQL_USER: next-terminal
|
||||
MYSQL_PASSWORD: next-terminal
|
||||
MYSQL_ROOT_PASSWORD: next-terminal
|
||||
ports:
|
||||
- "3306:3306"
|
||||
next-terminal:
|
||||
image: "dushixiang/next-terminal:latest"
|
||||
environment:
|
||||
DB: "mysql"
|
||||
MYSQL_HOSTNAME: "mysql"
|
||||
MYSQL_PORT: 3306
|
||||
MYSQL_USERNAME: "next-terminal"
|
||||
MYSQL_PASSWORD: "next-terminal"
|
||||
MYSQL_DATABASE: "next-terminal"
|
||||
ports:
|
||||
- "8088:8088"
|
||||
volumes:
|
||||
- /root/next-terminal/drive:/usr/local/next-terminal/drive
|
||||
- /root/next-terminal/recording:/usr/local/next-terminal/recording
|
||||
depends_on:
|
||||
- mysql
|
||||
```
|
||||
|
||||
3. 在`/root/next-terminal`文件夹下执行命令`docker-compose up`
|
||||
|
||||
|
||||
### 注意事项 ⚠️
|
||||
|
||||
1. docker连接宿主机器上的`mysql`时连接地址不是`127.0.0.1`,请使用`ipconfig`或`ifconfig`确认宿主机器的IP。
|
||||
2. 使用其他容器内部的`mysql`时请使用`--link <some-mysql-name>`,环境变量参数为`-e MYSQL_HOSTNAME=<some-mysql-name>`
|
||||
3. 使用独立数据库的需要手动创建数据库,使用docker-compose不需要。
|
||||
|
||||
## 环境变量
|
||||
|
||||
| 参数 | 含义 |
|
||||
|---|---|
|
||||
| DB | 数据库类型,默认 `sqlite`,可选`['sqlite','mysql']` |
|
||||
| SQLITE_FILE | `sqlite`数据库文件存放地址,默认 `'next-terminal.db'` |
|
||||
| MYSQL_HOSTNAME | `mysql`数据库地址 |
|
||||
| MYSQL_PORT | `mysql`数据库端口 |
|
||||
| MYSQL_USERNAME | `mysql`数据库用户 |
|
||||
| MYSQL_PASSWORD | `mysql`数据库密码 |
|
||||
| MYSQL_DATABASE | `mysql`数据库名称 |
|
||||
| SERVER_ADDR | 服务器监听地址,默认`0.0.0.0:8088` |
|
||||
| ENCRYPTION_KEY | 授权凭证和资产的密码,密钥等敏感信息加密的key,默认`next-terminal` |
|
||||
|
||||
## 其他
|
||||
|
||||
`next-terminal` 使用了`supervisord`来管理服务,因此相关日志在 `/var/log/supervisor/next-terminal-*.log`
|
||||
|
||||
程序安装目录地址为:`/usr/local/next-terminal`
|
||||
|
||||
录屏文件存放地址为:`/usr/local/next-terminal/recording`
|
||||
|
||||
远程桌面挂载地址为:`/usr/local/next-terminal/drive`
|
@ -1,186 +0,0 @@
|
||||
# 原生安装
|
||||
|
||||
## 安装 Apache Guacamole-Server
|
||||
|
||||
### Centos 安装Apache Guacamole-Server依赖文件
|
||||
|
||||
```shell
|
||||
yum install -y gcc cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel libwebsockets-devel libtool
|
||||
```
|
||||
|
||||
### Ubuntu 安装Apache Guacamole-Server依赖文件
|
||||
```shell
|
||||
sudo apt-get install libcairo2-dev libjpeg-turbo8-dev libpng12-dev libtool-bin libossp-uuid-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libwebsockets-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev
|
||||
```
|
||||
|
||||
### Debian 安装Apache Guacamole-Server依赖文件
|
||||
```shell
|
||||
sudo apt-get install libcairo2-dev libjpeg62-turbo-dev libpng-dev libtool-bin libossp-uuid-dev freerdp2-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libwebsockets-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev
|
||||
```
|
||||
|
||||
如有疑问可参考 [Guacamole官方安装文档](!https://guacamole.apache.org/doc/gug/installing-guacamole.html)
|
||||
|
||||
下载&解压&configure
|
||||
```shell
|
||||
wget https://archive.apache.org/dist/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz
|
||||
tar -xzf guacamole-server-1.3.0.tar.gz
|
||||
cd guacamole-server-1.3.0
|
||||
./configure --with-init-dir=/etc/init.d
|
||||
```
|
||||
|
||||
如果安装的依赖文件没有缺失的话,会看到`RDP` `SSH` `VNC` 都是 `yes`
|
||||
|
||||
```shell
|
||||
------------------------------------------------
|
||||
guacamole-server version 1.3.0
|
||||
------------------------------------------------
|
||||
|
||||
Library status:
|
||||
|
||||
freerdp2 ............ yes
|
||||
pango ............... yes
|
||||
libavcodec .......... no
|
||||
libavformat.......... no
|
||||
libavutil ........... no
|
||||
libssh2 ............. yes
|
||||
libssl .............. yes
|
||||
libswscale .......... no
|
||||
libtelnet ........... yes
|
||||
libVNCServer ........ yes
|
||||
libvorbis ........... yes
|
||||
libpulse ............ yes
|
||||
libwebsockets ....... yes
|
||||
libwebp ............. yes
|
||||
wsock32 ............. no
|
||||
|
||||
Protocol support:
|
||||
|
||||
Kubernetes .... yes
|
||||
RDP ........... yes
|
||||
SSH ........... yes
|
||||
Telnet ........ yes
|
||||
VNC ........... yes
|
||||
|
||||
Services / tools:
|
||||
|
||||
guacd ...... yes
|
||||
guacenc .... no
|
||||
guaclog .... yes
|
||||
|
||||
FreeRDP plugins: /usr/lib64/freerdp2
|
||||
Init scripts: /etc/init.d
|
||||
Systemd units: no
|
||||
|
||||
Type "make" to compile guacamole-server.
|
||||
```
|
||||
|
||||
编译和安装
|
||||
|
||||
```shell
|
||||
make && make install && ldconfig
|
||||
```
|
||||
|
||||
配置guacamole-server
|
||||
```shell
|
||||
mkdir /etc/guacamole/ && cat <<EOF >> /etc/guacamole/guacd.conf
|
||||
[daemon]
|
||||
pid_file = /var/run/guacd.pid
|
||||
log_level = info
|
||||
|
||||
[server]
|
||||
bind_host = 0.0.0.0
|
||||
bind_port = 4822
|
||||
EOF
|
||||
```
|
||||
|
||||
启动 guacamole-server
|
||||
```shell
|
||||
/etc/init.d/guacd start
|
||||
```
|
||||
|
||||
### 安装字体(SSH使用)
|
||||
|
||||
安装字体管理软件
|
||||
```shell
|
||||
yum install -y fontconfig mkfontscale
|
||||
```
|
||||
|
||||
下载字体文件并移动到` /usr/share/fonts/`目录下
|
||||
```shell
|
||||
cd /usr/share/fonts/
|
||||
wget https://raw.githubusercontent.com/dushixiang/next-terminal/master/web/src/fonts/Menlo-Regular-1.ttf
|
||||
```
|
||||
|
||||
更新字体
|
||||
```shell
|
||||
mkfontscale
|
||||
mkfontdir
|
||||
fc-cache
|
||||
```
|
||||
### 安装 Next Terminal
|
||||
> 示例步骤安装在 `/usr/local/next-terminal`,你可以自由选择安装目录。
|
||||
|
||||
下载
|
||||
```shell
|
||||
wget https://github.com/dushixiang/next-terminal/releases/latest/download/next-terminal.tgz
|
||||
```
|
||||
|
||||
解压
|
||||
```shell
|
||||
tar -zxvf next-terminal.tgz -C /usr/local/
|
||||
```
|
||||
|
||||
在`/usr/local/next-terminal`或`/etc/next-terminal`下创建或修改配置文件`config.yml`
|
||||
```shell
|
||||
db: sqlite
|
||||
# 当db为sqlite时mysql的配置无效
|
||||
#mysql:
|
||||
# hostname: 172.16.101.32
|
||||
# port: 3306
|
||||
# username: root
|
||||
# password: mysql
|
||||
# database: next-terminal
|
||||
|
||||
# 当db为mysql时sqlite的配置无效
|
||||
sqlite:
|
||||
file: 'next-terminal.db'
|
||||
server:
|
||||
addr: 0.0.0.0:8088
|
||||
# 当设置下面两个参数时会自动开启https模式(前提是证书文件存在)
|
||||
# cert: /root/next-terminal/cert.pem
|
||||
# key: /root/next-terminal/key.pem
|
||||
|
||||
# 授权凭证和资产的密码,密钥等敏感信息加密的key,默认`next-terminal`
|
||||
#encryption-key: next-terminal
|
||||
```
|
||||
|
||||
启动
|
||||
```shell
|
||||
./next-terminal
|
||||
```
|
||||
|
||||
使用系统服务方式启动
|
||||
|
||||
在 `/etc/systemd/system/` 目录创建 `next-terminal.service` 文件并写入以下内容
|
||||
```shell
|
||||
[Unit]
|
||||
Description=next-terminal service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/usr/local/next-terminal
|
||||
ExecStart=/usr/local/next-terminal/next-terminal
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
重载系统服务&&设置开机启动&&启动服务&&查看状态
|
||||
```shell
|
||||
systemctl daemon-reload
|
||||
systemctl enable next-terminal
|
||||
systemctl start next-terminal
|
||||
systemctl status next-terminal
|
||||
```
|
@ -1,69 +0,0 @@
|
||||
### 资源占用
|
||||
|
||||
未使用时资源占用非常小
|
||||
|
||||

|
||||
|
||||
### 控制面板
|
||||
|
||||
更方便的概览系统信息
|
||||
|
||||

|
||||
|
||||
### 资产管理
|
||||
|
||||
支持多种RDP、SSH、Telnet、VNC,Kubernetes等多种协议的资产
|
||||
|
||||

|
||||
|
||||
#### rdp
|
||||
|
||||

|
||||
|
||||
#### vnc
|
||||
|
||||

|
||||
|
||||
#### ssh
|
||||
|
||||

|
||||
|
||||
### 授权凭证
|
||||
|
||||
极为方便的复用资产认证信息
|
||||
|
||||

|
||||
|
||||
批量执行命令
|
||||
|
||||

|
||||
|
||||
### 在线监控
|
||||
|
||||
实时监控用户的操作,并可以随时断开该会话
|
||||
|
||||

|
||||
|
||||
### 离线回放
|
||||
|
||||
详细的数据回放,定位任何一个可疑操作
|
||||
|
||||

|
||||
|
||||
### 计划任务
|
||||
|
||||
自定义计划任务
|
||||
|
||||

|
||||
|
||||
### 访问安全
|
||||
|
||||
黑白名单访问控制,支持ip、cidr及连续IP
|
||||
|
||||

|
||||
|
||||
### 用户组授权
|
||||
|
||||
灵活的授权策略
|
||||
|
||||

|
Loading…
Reference in New Issue
Block a user