Files
tldr/pages.zh/freebsd/chpass.md

33 lines
828 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# chpass
> 添加或更改用户数据库信息,包括登录 shell 和密码。
> 另见:`passwd`。
> 更多信息:<https://man.freebsd.org/cgi/man.cgi?chpass>。
- 交互式为当前用户添加或更改用户数据库信息:
`su -c chpass`
- 为当前用户设置特定的登录 [s]hell
`chpass -s {{path/to/shell}}`
- 为特定用户设置登录 [s]hell
`chpass -s {{path/to/shell}} {{username}}`
- 更改账户 [e]xpire 时间自纪元起的秒数UTC
`su -c 'chpass -e {{time}} {{username}}'`
- 更改用户密码:
`su -c 'chpass -p {{encrypted_password}} {{username}}'`
- 指定要查询的 NIS 服务器的 [h]ostname 或地址:
`su -c 'chpass -h {{hostname}} {{username}}'`
- 指定特定的 NIS [d]omain默认系统域名
`su -c 'chpass -d {{domain}} {{username}}'`