Create New Document

The title of your document (will be displayed as H1)
URL-friendly name (no spaces, use dashes)
Path where to create document (optional, use forward slashes to create subdirectories)

Move/Rename Document

Current location of the document
New path for the document (including the slug)
This only changes the document's path. It does not modify the document's title (H1 heading).

Delete Document

Are you sure you want to delete this document? This action cannot be undone.

Warning: If this is a folder, all contents including subfolders and documents will be deleted.

Message

Message content goes here.

Confirm Action

Are you sure?

Attachments

Allowed file types: jpg, jpeg, png, gif, svg, webp, txt, log, csv, sfd, zip, pdf, docx, xlsx, pptx, mp4 (Max: 10MB)

Document Files

Loading attached files...

Document History

Previous Versions

Loading versions...

Preview

Select a version to preview

Wiki Settings

Language for the user interface
Number of versions to keep per document. Set to 0 to disable versioning.
Maximum allowed file size for uploads in MB.

User Management

Add New User

Leave empty to keep current password
Users with these groups can access restricted sections.

Define path-based access rules for sections of your wiki, then assign users to groups in the Users tab. Rules are evaluated in order. First match wins.

Active Rules

Import markdown files from a ZIP archive. Files will be processed and stored in the appropriate document structure. Directory structure in the ZIP (category/subcategory) will be preserved in the wiki.

Upload a ZIP file containing markdown (.md) files to import.

Create and manage backups of your wiki data. Backups include all documents, images, and configuration files.

Available Backups

Loading backups...

Add/Edit Access Rule

Selected: /

Add Column

Banner

Linux Server Account Security

创建一个普通用户(如 myuser)并配置好 sudo 权限

第一步:创建普通用户

参数说明:
-m:自动创建家目录
-s /bin/bash:指定默认 shell 为 bash

# 创建用户 myuser(会自动创建家目录 /home/myuser)
sudo useradd -m -s /bin/bash myuser

# 设置密码(输入时不会显示,需要输入两次)
sudo passwd myuser

第二步:配置 sudo 权限

有两种方式,推荐用第一种(更安全):

方式一:添加到 sudo 组(推荐)

# 将 myuser 添加到 sudo 组(Ubuntu/Debian)
sudo usermod -aG sudo myuser

# 如果是 CentOS/RHEL,组名是 wheel
sudo usermod -aG wheel myuser

验证:

# 切换到 myuser 测试
su - myuser

# 测试 sudo 权限
sudo whoami
# 应该输出 root(说明有 sudo 权限)

方式二:直接编辑 sudoers 文件(更精确控制)

# 编辑 sudoers 文件(注意:必须用 visudo,不能直接 vi)
sudo visudo

# 在文件末尾添加这行(保存退出)
myuser ALL=(ALL) ALL

不同配置的含义

配置 含义
myuser ALL=(ALL) ALL 完全权限(和 root 一样)
myuser ALL=(ALL) /usr/bin/apt 只能运行 apt 命令
myuser ALL=(ALL) NOPASSWD: ALL 不需要密码就能用 sudo(不推荐)

第三步:测试新用户登录

在退出 root 前,务必先用新用户登录测试!
测试方式 1:本机测试(推荐先做)

# 切换到 myuser
su - myuser

# 确认家目录正确
pwd
# 应该输出 /home/myuser

# 测试 sudo
sudo apt update  # Ubuntu/Debian
# 或
sudo yum list   # CentOS/RHEL
# 如果提示输入密码且成功执行,说明配置正确

测试方式 2:新开 SSH 窗口测试

# 打开一个新的终端窗口,用 myuser 登录
ssh myuser@你的服务器IP -p 端口号

# 输入密码登录后,测试 sudo
sudo whoami
# 应该输出 root

禁用 root 登录(关键安全步骤)

确认 myuser 能正常使用 sudo 后,再执行这一步:

# 编辑 SSH 配置
sudo vi /etc/ssh/sshd_config

# 找到并修改这两行:
PermitRootLogin no        # 禁止 root 登录
# 去掉 # 注释,改为:
PasswordAuthentication yes # 保持密码登录(如果你暂时不用密钥)

# 保存后重启 SSH
sudo systemctl restart sshd

重要:重启 SSH 后,不要关闭当前窗口!先开一个新窗口测试 myuser 能否登录,确认成功后再关闭旧窗口。否则如果配置出错,你可能会被锁在服务器外。

Attached Files

Loading attached files...
Search Results