Gaining Root Access on Vanilla Buffalo LinkStation 421E

Disclaimer

It should be noted the Buffalo Linkstation™ ACP Commander GUI used in my blog post is experimental and there’s a chance it could damage your LinkStation™. The entire documented process below worked fine for me however there is a chance it could not work for you. You have been warned

On To The Rooting

There is a site that provides you with a Java based GUI built around the Buffalo Linkstation™ ACP Commander called Buffalo Linkstation™ ACP Commander GUI. This program can be used to send commands to your LinkStation™ 421E via Telnet and in turn enable you to gain root access to your LinkStation™. You’ll need Java installed to run this and your LinkStation™ already configured and setup, so if you haven’t done either, now is the time to do them.

Once you’ve confirmed Java installed and your LinkStation™ is setup and configured:

  • Download the Buffalo Linkstation™ ACP Commander GUI
  • Run it. It should automatically find any LinkStation™ on your local LAN.
  • Once running, select your LinkStation™ from the drop-down list in the top left-hand corner and enter in your admin password. (This is the same admin password as the one you initially entered during the LinkStation setup process)
  • Once your admin password has been typed in you should be able to send commands now. To confirm it’s working try typing in ls and clicking on the Go! button.
  • You should receive a directory listing followed by:
Authenticate EnOneCmd... OK
Authenticate with admin pw... OK
OK (OK)

The last message above indicates that a command has successfully executed. Now that you can execute commands all that’s left is to enable SSHD and set the root password. There are two buttons available to do this: Enable SSH and Set root PW. Unfortunately both of these never helped and in fact undid any work I did to root the device. So instead I had to type in the following commands to get SSHD working (they need to be entered line-by-line), I’ve explained each command in bold below.

Make the SSH Init.d script executable

chmod 0755 /etc/init.d/sshd.sh

Change the root password, replacing «ROOTPASSWORD» with your desired root password

(echo <<ROOTPASSWORD>>;echo <<ROOTPASSWORD>>)|passwd

Perform some search-replaces on the sshd_config file to enable SSHD

sed -i 's/#Port 22/port 22/g' /etc/sshd_config
sed -i 's/#Protocol 2/Protocol 2/g' /etc/sshd_config
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/sshd_config
sed -i 's/#StrictModes yes/StrictModes yes/g' /etc/sshd_config
sed -i 's/\/usr\/lib\/sftp-server/\/usr\/local\/libexec\/sftp-server/g' /etc/sshd_config
sed -i 's/"${SUPPORT_SFTP}" = "0"/"${SUPPORT_SFTP}" = "1"/g' /etc/init.d/sshd.sh

Restart SSHD

/etc/init.d/sshd.sh restart

After executing these commands you should be able to SSH using root as the username and the password you set earlier.

I currently also have a Debian Wheezy running as my LinkStation™’s operating system and plan to get other Linux distros working on it but that will be part of another post.

I hope this helps anyone trying to root their LinkStation™ 421E, if you have any question feel free to comment below.

Other posts in the Hacking series:
  1. Assigning Static IPv4 and IPv6 Private Addresses using Dnsmasq
  2. Gaining Root Access on Vanilla Buffalo LinkStation 421E (current)

Comments