useradd -M -s /sbin/nologin prometheus -g prometheus
时间: 2024-05-27 19:11:27 浏览: 157
This command creates a new user called "prometheus" with the following options:
- "-M" creates a user without a home directory
- "-s /sbin/nologin" sets the login shell to "/sbin/nologin", which prevents the user from logging in
- "-g prometheus" sets the primary group of the user to "prometheus"
Overall, this command is useful for creating a user that is solely dedicated to running the Prometheus monitoring system, without allowing any login access.
阅读全文