MCPcopy Create free account
hub / github.com/clawshell/clawshell / create_system_user

Function create_system_user

src/platform/linux.rs:67–77  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

65}
66
67pub fn create_system_user(name: &str) -> Result<(), Error> {
68 let mut command = Command::new("useradd");
69 command.args([
70 "--system",
71 "--no-create-home",
72 "--shell",
73 "/usr/sbin/nologin",
74 name,
75 ]);
76 command_status(&mut command, "useradd")
77}
78
79pub fn delete_system_user(name: &str) -> Result<(), Error> {
80 let mut command = Command::new("userdel");

Callers 1

cmd_onboardFunction · 0.50

Calls 1

command_statusFunction · 0.85

Tested by

no test coverage detected