Friday 22 May 2015

Updating Ubiquiti over SSH command line

For anyone who uses Ubiquiti kit (and if you don't why not.. their kit rocks) the following 3 commands allow you to update the config over ssh:

vi /tmp/system.cfg

cfgmtd -f /tmp/system.cfg -w

/usr/etc/rc.d/rc.softrestart save

Useful *nix commands

Carving DNS A record lookups using tcpdump, grep and awk:

tcpdump -lnv port 53 | grep -E 'A\?' | awk '{print $(NF-6),$(NF-5),$(N

Friday 20 February 2015

Reset Ubuntu root password

So today I forgot the root password to an Ubuntu VM I was playing with recently.  Did the normal thing [1] and hit escape at the grub boot screen and dropped to a root shell followed by the command to reset the password on the account..

passwd <account name>

and was greeted with:

passwd: Authentication token manipulation error
passwd: password unchanged

So with a bit of help from google [2] it turns out the drive just needs to be mounted read/write:

mount -rw -o remount /

before running the passwd command as before.