This commit is contained in:
parent
a3da9fb9ac
commit
40a1498c6f
7 changed files with 72 additions and 15 deletions
|
@ -4,6 +4,10 @@ use crate::{
|
|||
print_status,
|
||||
};
|
||||
|
||||
pub fn change_passwd(user: &str, pw: &str) {
|
||||
arch_chroot(&["passwd", user], Some(&format!("{}\n{}\n", pw, pw)), false);
|
||||
}
|
||||
|
||||
/// Setup the users of the system
|
||||
pub fn setup_users(conf: &[UserConfig]) {
|
||||
let mut doas_conf = String::new();
|
||||
|
@ -11,11 +15,7 @@ pub fn setup_users(conf: &[UserConfig]) {
|
|||
for user in conf {
|
||||
arch_chroot(&["useradd", "-m", &user.name], None, false);
|
||||
|
||||
arch_chroot(
|
||||
&["passwd", &user.name],
|
||||
Some(&format!("{}\n{}\n", user.password, user.password)),
|
||||
false,
|
||||
);
|
||||
change_passwd(&user.name, &user.password);
|
||||
|
||||
if user.doas_root {
|
||||
print_status(&format!("Allowing root doas for {}", user.name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue