So I was given a Cisco/Linksys NSS6000 to upgrade and root. Luckily I have was also provisioned with the instructions to root this machine.
Thanks to some hacker types that had already been and done this the process was relatively straight forward.
- Create User
- Insert USB Key
- Backup Configuration onto USB Key
- Unmount USB Key
- Dive into the tar ball (which is simply /etc) and:
- Change the root password in etc/password – I just copied my new users password!
- Added the following line to etc/cron.d/root
*/5 * * * * /usr/sbin/dropbear_start.sh
- Tar the extracted files
- Put the tarball back on the USB drive
- Mount it in the NAS and Restore from backup
- Profit, Right!?
Well, nearly. I had a couple of issues:
Incorrect tarball Permissions
So, my first derp was when I tar’d the etc folder back up and well… instead of root owning everything, you get the picture.
What happens is that you get an error like this:
Warning: touch(): Unable to create file /etc/nas/ran_wizard because Permission denied in /www/html/index.php on line 48
And you end up getting into a loop with dialog boxes and never ending redirects to the same page.
The down side of this is that you cannot get to any other pages in the administration to even consider doing a factory reset. Luckily you *can* post to it still
curl --data "p=admin&s=maintenance&restore_all=Restore+ALL+Settings+to+Factory+Defaults" http://admin:firstname.lastname@example.org/index.php
This command will reset the device to factory defaults – you should change the IP address and user/pass to what you need it to be. It obviously uses cURL so you will need that too 🙂
We also tried to overwrite the start of the one disk we had (using dd if=/dev/zero…) in the machine to see if that would work – but alas it did not. We were able to go through the setup wizard again, but ended back at the loop we had before.
SSH Connection Closed
The second problem I had was ssh’ing to the box. We discovered that if we used an older version of openSSH we could connect to it, but newer versions of openSSH would just not connect.
Pro Tip: Putty connects fine 🙂
To be able to connect to older dropbear’s with newer openSSH clients – try this in your ssh_config file
jason@workstation:~$ cat ~/.ssh/config
I hope this information saves someone a few hours of frustrations.