Friday, February 20, 2026

Re: single user machine, one "user" now(?) has no password (I didn't do it). [edited for clarity]

(I'm having difficulties with Gmail; my and others' emails don't seem to be showing up.)


> No.
>Most likely your script is buggy.

I've been over the main script, there's not much there to be buggy

> Without seeing the script, it's not possible to give a definite answer.

If I type it out on my phone are you willing to tell me what I'm not seeing?
I've done that below.
It may worth repeating that I saw no issues with the other ten or so user accounts.
I will show the password generator, if asked; but I believe it will not output an empty string. (It mainly reads from /dev/random, to get printable characters, not very guessable, I would think.)

There would have to be something different about the invocation that generated this user, and I'm not seeing how that's possible.

Here's the main script:
#!/bin/ksh
userinfo -e "$1" && { print exists; exit 1;}
[ -e /home/"$1" ] && { print ERR: \$HOME; exit 1;}

uid=1000; until ! userinfo -e $uid; do ((++uid));done
gid=1000; until ! userinfo -e $gid; do ((++gid));done
pw="$(/somedir/pwgenenerator|encrypt -c localuser)"
printf '%s\n' a "$1:$pw:$uid:$gid:localuser:0:0::/home/$1:/bin/ksh" . wq | EDITOR='ed -s' vipw
print "$1:*:$gid" >> /etc/group

umask 027
cp -RP /etc/skel /home/"$1"
cd /morefiles
cp -a .* /home/"$1"
chmod -R o-rwx /home/"$1"
chown -R "$1":"$1" /home/"$1"
cd /home/"$1"/.config/chromium/Default/
print "($PWD)\nrename to Preferences\n$(ls)"


No comments:

Post a Comment