← 返回命令列表

Linux command

systemd-firstboot 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Operate

sudo systemd-firstboot --root [path/to/root_directory]

Set

sudo systemd-firstboot --keymap [keymap]

Set

sudo systemd-firstboot --hostname [hostname]

Set

sudo systemd-firstboot --root-password [password]

Prompt

sudo systemd-firstboot --prompt [setting]

Force

sudo systemd-firstboot --force

Remove

sudo systemd-firstboot --reset

Remove

sudo systemd-firstboot --delete-root-password

说明

systemd-firstboot initializes basic system settings on or before the first boot of a system. It is typically used when preparing OS images or system installations. The tool can set hostname, locale, timezone, keyboard layout, and root password. When run without options on a live system, it interactively prompts for unconfigured settings.

参数

--root _path_
Operate on specified root directory
--hostname _name_
Set the system hostname
--keymap _map_
Set the keyboard layout
--timezone _tz_
Set the system timezone
--locale _locale_
Set the system locale
--root-password _password_
Set root's password
--root-shell _shell_
Set root's login shell
--prompt
Prompt interactively for settings
--force
Overwrite existing configuration
--reset
Remove all firstboot configuration files
--delete-root-password
Remove root password

FAQ

What is the systemd-firstboot command used for?

systemd-firstboot initializes basic system settings on or before the first boot of a system. It is typically used when preparing OS images or system installations. The tool can set hostname, locale, timezone, keyboard layout, and root password. When run without options on a live system, it interactively prompts for unconfigured settings.

How do I run a basic systemd-firstboot example?

Run `sudo systemd-firstboot --root [path/to/root_directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --root _path_ do in systemd-firstboot?

Operate on specified root directory