3.7.  Supported Image Customizations


A number of image customizations are supported in blueprints. In order to make use of these options, you need to initially configure them in the blueprint and then use the command push to import the modified blueprint to Image Builder.
注意
These customizations are not currently supported in the accompanying `cockpit-composer` GUI.
Set the image host name
[customizations]
hostname = "baseimage"
Copy to Clipboard Toggle word wrap
User specifications for the resulting system image
[[customizations.user]]
name = "USER-NAME"
description = "USER-DESCRIPTION"
password = "PASSWORD-HASH"
key = "PUBLIC-SSH-KEY"
home = /home"/USER-NAME/"
shell = "/usr/bin/bash"
groups = ["users", "wheel"]
uid = NUMBER
gid = NUMBER
Copy to Clipboard Toggle word wrap
Only the user name is required, you can leave out any other lines.
Replace PASSWORD-HASH with the actual password hash. To generate the hash, use a command such as:
$ python3 -c 'import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass("Confirm: ")) else exit())'
Copy to Clipboard Toggle word wrap
重要
To generate the hash, you must have the python3 package on your system. Use the following command to install the package:
# yum install python3
Copy to Clipboard Toggle word wrap
Replace PUBLIC-SSH-KEY with the actual public key.
Repeat this block for every user you want to include.
Group specifications for the resulting system image
[[customizations.group]]
name = "GROUP-NAME"
gid = NUMBER
Copy to Clipboard Toggle word wrap
Repeat this block for every group you want to include.
Set an existing user's ssh key
[[customizations.sshkey]]
user = "root"
key = "PUBLIC-SSH-KEY"
Copy to Clipboard Toggle word wrap
注意
This option is only applicable for existing users. To create a user and set an ssh key, use the User specifications for the resulting system image customization.
Append a kernel boot parameter option to the defaults
[[customizations.kernel]]
append = "KERNEL-OPTION"
Copy to Clipboard Toggle word wrap
Set the image host name
[customizations]
hostname = "BASE-IMAGE"
Copy to Clipboard Toggle word wrap
Add a group for the resulting system image
[[customizations.group]]
name = "USER-NAME"
gid = NUMBER
Copy to Clipboard Toggle word wrap
Only the name is required and GID is optional.
Set the timezone and the Network Time Protocol (NTP) servers for the resulting system image
[customizations.timezone]
timezone = "TIMEZONE"
ntpservers = NTP-SERVER
Copy to Clipboard Toggle word wrap
If you do not set a timezone, the system uses Universal Time, Coordinated (UTC) as default. Setting NTP servers is optional.
Set the locale settings for the resulting system image
[customizations.locale]
language = "[LANGUAGE]"
keyboard = "KEYBOARD"
Copy to Clipboard Toggle word wrap
Setting both language and keyboard options is mandatory. You can add multiple languages. The first language you add will be the primary language and the other languages will be secondary.
Set the firewall for the resulting system image
[customizations.firewall]
port = "[PORTS]"
Copy to Clipboard Toggle word wrap
You can use the numeric ports, or theirs names from the `/etc/services` file to enable or disable lists.
Set which services to enable during the boot time
[customizations.services]
enabled = "[SERVICES]"
disabled = "[SERVICES]"
Copy to Clipboard Toggle word wrap
You can control which services to enable during the boot time. Some image types already have services enabled or disabled so that the image works correctly and this setup cannot be overridden.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部