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