Skip to content

Instantly share code, notes, and snippets.

@luelista
Created June 27, 2015 15:18
Show Gist options
  • Save luelista/c5cedaa4a6ec946b278e to your computer and use it in GitHub Desktop.
Save luelista/c5cedaa4a6ec946b278e to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
open SHD, "<", "/etc/shadow" or die "cannot open /etc/shadow: $_";
while(<SHD>) {
@fields = split /:/;
print("\ndn: uid=$fields[0],ou=People,dc=fachschaft,dc=informatik,dc=tu-darmstadt,dc=de\n");
print("changetype: modify\n");
print("replace: userPassword\n");
print("userPassword: {crypt}$fields[1]\n");
}
close SHD;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment