> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man8/password.lua.8.md).

# password.lua.8

`password.lua` — 引导加载器密码模块

## 名称

`password.lua`

## 描述

`password.lua` 包含提示输入和检查密码的功能。

在使用 `password.lua` 提供的功能之前，必须使用如下语句将其包含：

```lua
local password = require("password")
```

以下函数从 `password.lua` 导出：

**`password.read(prompt_length)`** 在提示后读取密码。需要 `prompt_length` 以便在用户输入时正确绘制旋转符。

**`password.check()`** 驱动加载器完成的主要密码检查。`password.check()` 函数将检查 `bootlock_password`、`geom_eli_passphrase_prompt` 和 `password`，并按需提示用户输入密码。如果设置了 `password`，则在提示用户输入密码时将开始自动引导序列。

## 参见

screen.lua(8)

## 作者

`password.lua` 文件最初由 Pedro Souza <pedrosouza@FreeBSD.org> 编写。后续工作及本手册页由 Kyle Evans <kevans@FreeBSD.org> 完成。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man8/password.lua.8.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
