Skip to main content

add_user_and_home

Function add_user_and_home 

Source
pub(crate) fn add_user_and_home(user: &SystemUserId) -> Result<(), Error>
Expand description

Adds a specific Unix user and its home, if it does not exist yet.

In addition, the system record for user is modified to be unlocked.

§Note

Requires the commands useradd and usermod to be present on the system.

§Errors

Returns an error, if

  • retrieving user information on the system fails
  • creation of the user and its home fails
  • unlocking of the user fails