a third attempt at setting the password

axtloss/rework-partitioning
amy 3 years ago
parent 1a0e4775e3
commit 7eba5709ba

@ -56,16 +56,10 @@ pub fn root_pass(root_pass: &str) {
"bash",
vec![
String::from("-c"),
String::from("'usermod"),
String::from("--password"),
String::from("$(echo"),
String::from(root_pass),
String::from("|"),
String::from("openssl"),
String::from("passwd"),
String::from("-1"),
String::from("-stdin)"),
String::from("root'"),
format!(
"'usermod --password $(echo {} | openssl passwd -1 -stdin) root'",
root_pass
),
],
),
"set root password",

@ -179,8 +179,6 @@ fn main() {
app.value_of("password").unwrap(),
);
} else if let Some(app) = app.subcommand_matches("rootPass") {
let rootpass = app.value_of("rootPass").unwrap();
println!("{}", rootpass);
users::root_pass(app.value_of("rootPass").unwrap());
}
} else if let Some(app) = app.subcommand_matches("desktops") {

Loading…
Cancel
Save