This commit is contained in:
parent
fa6439bce8
commit
7e9a2a1882
1 changed files with 2 additions and 7 deletions
|
@ -56,12 +56,7 @@ pub fn create_iso(
|
||||||
|
|
||||||
if let Some((user, pass, uid)) = user {
|
if let Some((user, pass, uid)) = user {
|
||||||
print_status(&format!("Setting user {user}"));
|
print_status(&format!("Setting user {user}"));
|
||||||
let hashed_pw = run_command(
|
let hashed_pw = run_command(&["openssl", "passwd", "-6", pass.as_str()], None, false).0;
|
||||||
&["openssl", "passwd", "-6"],
|
|
||||||
Some(&format!("{pass}\n{pass}\n")),
|
|
||||||
false,
|
|
||||||
)
|
|
||||||
.0;
|
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
"./iso/airootfs/etc/doas.conf",
|
"./iso/airootfs/etc/doas.conf",
|
||||||
format!("permit persist {user} as root\n"),
|
format!("permit persist {user} as root\n"),
|
||||||
|
@ -71,7 +66,7 @@ pub fn create_iso(
|
||||||
std::fs::write("./iso/airootfs/etc/passwd", format!("root:x:0:0:root:/root:/usr/bin/zsh\n{user}:x:{uid}:{uid}::/home/{user}:/usr/bin/zsh\n")).unwrap();
|
std::fs::write("./iso/airootfs/etc/passwd", format!("root:x:0:0:root:/root:/usr/bin/zsh\n{user}:x:{uid}:{uid}::/home/{user}:/usr/bin/zsh\n")).unwrap();
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
"./iso/airootfs/etc/shadow",
|
"./iso/airootfs/etc/shadow",
|
||||||
format!("root::14871::::::\n{user}:{hashed_pw}"),
|
format!("root::14871::::::\n{user}:{hashed_pw}:14871::::::"),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
|
|
Loading…
Add table
Reference in a new issue