Dearest Gods,
[b]I ran this, got the password:[/b]
sudo tdbdump /var/db/samba/secrets.tdb
[b]I created this with TextWrangler and saved it in /usr/bin as a executable file:[/b]
#!/usr/bin/expect -f
#Hack to change samba machine password non-interactively
set machinepw [lindex $argv 0]
spawn net -f changesecretpw
expect “password:”
send “$machinepw\r”
expect eof
[b]I ran this:[/b]
sudo changesecret $(defaults read /Library/Preferences/DirectoryService/ActiveDirectory “AD Computer Password”| /usr/bin/tr -d “< >” | /usr/bin/xxd -r -p)
[b]I ran this again but the output was simply “\00” for the password:[/b]
sudo tdbdump /var/db/samba/secrets.tdb
[b]Rebooted but the password stayed as “\00″[/b]
[b]Please, please tell me what I’m doing wrong, even if you feel the need to state the very obvious like creating the script[/b]
😐
Recent Comments