Skip to content

Instantly share code, notes, and snippets.

Last active Nov 19, 2018
What would you like to do?
# on as root
unshadow /etc/passwd /etc/shadow > linux_passwd
cat linux_passwd | awk -F : '{printf("%s:%s:%s:%s::0:0:%s:%s:%s\n", $1,$2,$3,$4,$5,$6,$7); }' > new_passwd
# edit new_passwd to include only new users
# now on bsd box, switch to root shell
scp .
cat new_passwd >> /etc/master.passwd
pwd_mkdb -p /etc/master.passwd
for user in $(cut -d : -f 1 < new_passwd); do
mkdir -p /home/$user/.ssh
scp$user/.ssh/authorized_keys /home/$user/.ssh/
chown -R $user:team /home/$user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment