Last active
November 19, 2018 21:02
-
-
Save benharri/2a515dbde2dfdf3294dffe7b1be56e67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on tilde.team 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 tilde.team:/root/new_passwd . | |
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 tilde.team:/home/$user/.ssh/authorized_keys /home/$user/.ssh/ | |
chown -R $user:team /home/$user | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment