|
|
@ -33,16 +33,10 @@ pub fn new_user(username: &str, hasroot: bool, password: &str) {
|
|
|
|
"bash",
|
|
|
|
"bash",
|
|
|
|
vec![
|
|
|
|
vec![
|
|
|
|
String::from("-c"),
|
|
|
|
String::from("-c"),
|
|
|
|
String::from("'usermod"),
|
|
|
|
format!(
|
|
|
|
String::from("--password"),
|
|
|
|
r#"'usermod --password $(echo {} | openssl passwd -1 -stdin) {}'"#,
|
|
|
|
String::from("$(echo"),
|
|
|
|
password, username
|
|
|
|
String::from(password),
|
|
|
|
),
|
|
|
|
String::from("|"),
|
|
|
|
|
|
|
|
String::from("openssl"),
|
|
|
|
|
|
|
|
String::from("passwd"),
|
|
|
|
|
|
|
|
String::from("-1"),
|
|
|
|
|
|
|
|
String::from("-stdin)"),
|
|
|
|
|
|
|
|
format!("{}'", username),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
format!("Set password for user {}", username).as_str(),
|
|
|
|
format!("Set password for user {}", username).as_str(),
|
|
|
|