Home > Article > Computer Tutorials > How to create a non-login user in Linux?
In Linux, you can create a non-login user by following these steps:
Use the following command to create a non-login user, replacing "username" with the username you want to create:
sudo useradd -r username
-r
option specifies that the created user is a system user, also known as a non-login user. This type of user is typically used to run system services or specific applications. If you want to set a password for this user, you can use the following command:
sudo passwd username
You will be prompted to enter your new password and confirm it. If you don't want to set a password, you can skip this step.
Please note that creating a non-login user will only generate a user account and will not automatically set the home directory or other permissions for it. If you need to assign specific permissions or access controls to this user, please further configure the user settings.
Through the above method, you can create a non-login user in the Linux system and set a password for it (optional). This type of user is suitable for running system services or specific applications without logging into the system.
The above is the detailed content of How to create a non-login user in Linux?. For more information, please follow other related articles on the PHP Chinese website!