AdminPassword - Wiki & Documentation
欢迎来到 AdminPassword 的维基!该插件为您的服务器管理员提供了一个强大、轻量且可靠的防护层。它强制拥有 OP(操作员)权限的玩家在执行任何命令或使用特定于 OP 的游戏功能之前,必须通过密码进行身份验证。
? 概述
AdminPassword 旨在防止在管理员账户被盗用时发生未授权访问。
- 命令拦截: 未经身份验证的 OP 玩家无法使用任何命令。
- 快捷方式拦截: 拦截原生 Minecraft 客户端的 OP 快捷键(例如
F3+F4 切换游戏模式),这些快捷键会绕过标准的命令监听器。
- 静默轮询: 自动检测玩家在已登录服务器时是否获得 OP 权限,并立即将其锁定。
- 日志脱敏: 密码绝不会泄露。控制台中的命令日志会被掩码处理(显示为
/ap [***])。
?️ 架构与工作原理
AdminPassword 采用双向同步架构,使其既适用于独立服务器,也完美适配大型代理网络(Velocity)。
1. 独立 Bukkit/Paper 模式
如果您运行的是没有代理的单个服务器,只需将 adminpassword-bukkit-X.X.X.jar 放入您的 plugins 文件夹即可。
当一名 OP 玩家加入时,插件会锁定其命令。一旦他们输入 /ap <密码>,将在其整个会话期间获得验证。如果他们断开连接,会话将被清除。
2. 网络模式(Velocity + Bukkit)-> "同步护盾"
如果你拥有一个代理网络,可以在 Velocity 和所有后端的 Bukkit 服务器上安装该插件。这将构建出一个符合行业标准的“同步护盾”:
-
验证: 玩家加入 Lobby 服务器并输入 /ap <密码>。
-
**同步信息:**大厅中的 Bukkit 插件会验证密码,并静默地向 Velocity 代理发送一条插件消息(adminpw:sync),内容为:“该玩家已验证,请记住他们。”
-
**切换服务器:**玩家进入通往 Survival 服务器的传送门。
-
同步下行: 当玩家连接时,Velocity 向 Survival 服务器低语:“嘿,我认识这个玩家,他已经输入过密码了。放行他!”
-
结果: 玩家在每次代理会话中只需输入一次密码,但能在每个后端服务器上享受到物理强制实施的最高级别安全性(例如 F3+F4 拦截)。
? 安装
适用于独立服务器(Paper/Spigot/Bukkit)
- 下载
adminpassword-bukkit.jar。
- 将其放入
/plugins 文件夹中。
- 重启服务器。
- 编辑
plugins/adminpassword/config.yml 以更改默认密码。
- 再次重启或重新加载服务器。
适用于代理网络(Velocity)
- 将
adminpassword-bukkit.jar 放入所有后端服务器的 /plugins 文件夹中。
- 将
adminpassword-velocity.jar 放入你的 Velocity 代理的 /plugins 文件夹中。
- 重启代理和所有后端服务器。
- 在所有服务器(包括 Proxy 和 Bukkit 服务器)的
config.yml 文件中设置相同的密码。
- 可选: 如果你希望 Velocity 在验证前也拦截特定于代理的命令,请通过 LuckPerms 给予代理级管理员
adminpassword.protected 权限。
⌨️ 命令与权限
| 命令 |
别名 |
描述 |
权限要求 |
/ap <密码> |
/admin, /adminpassword |
验证管理员身份。 |
无(仅对 OP 有效) |
(注意:普通玩家输入 /ap 时,只会收到“无权限”的提示,且不会计入密码尝试次数。)
⚙️ 配置文件 (config.yml)
# OP 解锁账户所需的主密码。
admin-password: "changeme123"
如果玩家超过最大尝试次数,插件应该怎么做?
选项:仅警告(WARN_ONLY)、X 次后踢出(KICK_AFTER_X)、X 次后封禁(BAN_AFTER_X)
wrong-password-action: KICK_AFTER_X
在触发上述操作之前,最多允许多少次失败尝试?
max-attempts: 5
应该阻止哪些命令?
ALL:阻止所有命令。
LIST:仅阻止 blocked-commands 列表中定义的命令。
block-mode: ALL
仅在 block-mode 设置为 LIST 时使用。
blocked-commands:
messages:
not-verified: "&c你必须输入管理员密码才能使用命令:/ap <password>"
wrong-password: "&c密码错误!剩余尝试次数:{left}"
correct-password: "&a密码验证通过!欢迎回来,管理员。"
kicked-message: "&c由于多次输入管理员密码失败,你已被踢出服务器。"
no-permission: "&c未知命令。输入 "/help" 获取帮助。"
---
## ❓ 常见问题解答
**Q:我是否需要为 OP(管理员)分配权限以便进行检查?**
**A:** 在 Bukkit/Paper 上,**不需要**。插件会自动检测玩家是否满足 `isOp() == true`。在 Velocity 上,它会检查 `adminpassword.protected` 权限,因为代理无法原生查看后端的 OP 列表。
**Q:它能否防护 F3+F4 切换游戏模式的操作?**
**A:** **可以。** 与大多数仅监听文本命令的插件不同,AdminPassword 会直接拦截游戏模式更改的数据包,前提是 OP 尚未验证。
**问:如果有人使用控制台在玩家在线时给予其 OP(管理员权限)怎么办?**
**答:** AdminPassword 具备一个隐蔽的轮询任务。它每 2 秒扫描一次服务器。如果普通玩家突然获得 OP 权限,插件将立即锁定其命令并要求输入密码。
AdminPassword - Wiki & Documentation
Welcome to the AdminPassword wiki! This plugin provides a robust, lightweight, and foolproof security layer for your server's Administrators. It forces OP players to verify themselves with a password before executing any commands or using OP-specific game features.
? Overview
AdminPassword is built to prevent unauthorized access if an Admin's account gets compromised.
- Command Blocking: Unverified OPs cannot use any commands.
- Shortcut Blocking: Blocks native Minecraft client OP shortcuts (e.g.,
F3+F4 gamemode switcher) which bypass standard command listeners.
- Stealth Polling: Automatically detects if a player receives OP status while already playing on the server, locking them down immediately.
- Log Masking: Passwords are never leaked. Command logs in the console are masked (
/ap [***]).
?️ Architecture & How It Works
AdminPassword uses a Bidirectional Sync Architecture, making it flawless for both standalone servers and massive proxy networks (Velocity).
1. Standalone Bukkit/Paper Mode
If you run a single server without a proxy, simply drop the adminpassword-bukkit-X.X.X.jar into your plugins folder.
When an OP player joins, the plugin locks their commands. Once they type /ap <password>, they are verified for the duration of their session. If they disconnect, the session is wiped.
2. Network Mode (Velocity + Bukkit) -> "The Synchronized Shield"
If you own a proxy network, you can install the plugin on Velocity AND all backend Bukkit servers. This creates an industry-standard "Synchronized Shield":
- Verification: A player joins the
Lobby server and types /ap <password>.
- Syncing Up: The Bukkit plugin in the Lobby verifies the password and silently sends a Plugin Message (
adminpw:sync) to the Velocity proxy saying: "This player is verified, remember them."
- Switching Servers: The player enters the portal to the
Survival server.
- Syncing Down: While the player connects, Velocity whispers to the
Survival server: "Hey, I know this player, they already entered the password. Unlock them!"
- Result: The player only types their password once per proxy session, but enjoys maximum security (like F3+F4 blocking) physically enforced on every backend server.
? Installation
For Standalone Servers (Paper/Spigot/Bukkit)
- Download
adminpassword-bukkit.jar.
- Place it in your
/plugins folder.
- Restart the server.
- Edit the
plugins/adminpassword/config.yml to change the default password.
- Restart again or reload the server.
For Proxy Networks (Velocity)
- Place
adminpassword-bukkit.jar in all of your backend servers' /plugins folders.
- Place
adminpassword-velocity.jar in your Velocity proxy's /plugins folder.
- Restart the proxy and all backend servers.
- Set the same password in the
config.yml files across all servers (Proxy and Bukkit servers).
- Optional: Give proxy-level admins the
adminpassword.protected permission via LuckPerms on Velocity if you want Velocity to also block proxy-specific commands before verification.
⌨️ Commands & Permissions
| Command |
Aliases |
Description |
Permission |
/ap <password> |
/admin, /adminpassword |
Verifies the administrator. |
None (Only works for OPs) |
(Note: Normal players who type /ap will simply receive a "No permission" message without counting as a failed password attempt).
⚙️ Configuration (config.yml)
# The master password required for OPs to unlock their accounts.
admin-password: "changeme123"
# What should the plugin do if the player exceeds the max attempts?
# Options: WARN_ONLY, KICK_AFTER_X, BAN_AFTER_X
wrong-password-action: KICK_AFTER_X
# How many failed attempts before the action above is triggered?
max-attempts: 5
# Which commands should be blocked?
# ALL: Blocks everything.
# LIST: Blocks only the commands defined in the blocked-commands list.
block-mode: ALL
# Used only if block-mode is set to LIST.
blocked-commands:
- "op"
- "deop"
- "stop"
- "ban"
messages:
not-verified: "&cYou must enter the admin password to use commands: /ap <password>"
wrong-password: "&cIncorrect password! Attempts left: {left}"
correct-password: "&aPassword verified! Welcome back, Admin."
kicked-message: "&cYou have been kicked for too many failed admin password attempts."
no-permission: "&cUnknown command. Type \"/help\" for help."
❓ FAQ
Q: Do I need to give permissions for OPs to be checked?
A: On Bukkit/Paper, no. The plugin automatically detects if a player has isOp() == true. On Velocity, it checks for the adminpassword.protected permission, as proxies cannot natively see backend OP lists.
Q: Does it protect against F3+F4 gamemode switching?
A: Yes. Unlike most plugins that only listen to text commands, AdminPassword directly blocks the game mode change packet if the OP is unverified.
Q: What if someone uses the console to give a player OP while they are online?
A: AdminPassword features a stealth Polling Task. It scans the server every 2 seconds. If a normal player suddenly becomes OP, the plugin will immediately lock their commands and ask for the password.
评论 0
登录后参与评分
还没有评论,来抢沙发吧