WD MyBook World Edition

I had just bought the WD MyBook World Edition a while ago, since I needed some kind of storage solution that wouldn’t occupy yet another USB/firewire port and could be accessed from different machines at the same time. As such, the MyBook World Edition appeared to be an inexpensive NAS solution for my case and since I already owned a MyBook, the decision wasn’t too hard either.

Of course I wouldn’t want to use those strange MioNet components, be it on the NAS itself or  on the client side and since I knew it was based on Linux, I used Google to get informed. Now, I made a mistake there. I followed the (slightly incomplete) recipe on this page just to find out that it was inconvenient to start SSH “manually” over and over again after a reboot of the MyBook. Now, there is another page which offers about the same as the first one, but in a variation. Slight problem, the first script (which I ran) contains the somewhat inconvenient line:
/usr/bin/passwd -d root
which sets the root password to be empty.

Too bad for me, since, as I found out from this Wiki, by means of the compressed images of a “virgin” MyBook, the /etc/sshd_config file contained the following line:
#PermitEmptyPasswords no
(i.e. by default empty passwords were not allowed, even though the line is commented out). Also the username that I thought I had created wouldn’t work, so I was seemingly doomed to use the standard web-interface of the NAS. But wait … didn’t I have the source of those PHP/shell scripts and the directory structure of the MyBook system? Indeed, so the best solution I could come up with, was to build “my own” firmware update server and feed the MyBook a script that would exchange this bloody line in /etc/sshd_config. So I did and the next thing I got when connecting via SSH was the root shell. Very convenient. Now I have a little file server in my room on the bookshelf, nomen est omen :mrgreen:

At the moment I compile ncurses to install nano and proceed in customizing my MyBook 😉

// Oliver

This entry was posted in EN, Programming, Software. Bookmark the permalink.

4 Responses to WD MyBook World Edition

  1. Joe says:

    Hi Oliver,

    could you share your solution on how to build your own firmware update server and repair a “corrupted” /etc/sshd_config? (I ran into the problem of setting “PermitRootAccess no” and later noticing that busybox was compiled without su/sudo. Now can’t change teh script anymore without root rights.)

    Thanks a lot,
    Joe

  2. Oliver says:

    Yep, I do have the source still on my server.

    Go here (the parameters are necessary, otherwise there will be no response), this is the link the WD expects to see. You can feed this to the firmware_upgrade.pl (which will pass the above mentioned parameters) like this:

    http://your_wd_ip_or_dnsname/auth/firmware_upgrade.pl?fwserver=deepthought.assarbad.net/mybook/firmware_source.php

    The aforementioned PHP script contains only a link to the actual “firmware” (which is a shell script). This shell script is being executed by the firmware_upgrade.pl and will be able to reset the PermitRootAccess value to “yes”. Actually that’s all it does. Go inspect it or look here:

    #!/bin/sh
    
    echo '#!/bin/sh' > /var/upgrade/upgrade1.sh
    chmod 755 /var/upgrade/upgrade1.sh
    
    SSHD_CONFIG=/etc/sshd_config
    SSHD_CONFIG_BAK=/etc/sshd_config.bak
    
    cp $SSHD_CONFIG $SSHD_CONFIG_BAK
    sed 's/^#PermitEmptyPasswords no/PermitEmptyPasswords yes/' \
      < $SSHD_CONFIG_BAK > $SSHD_CONFIG
    
    /etc/init.d/S29sshd restart
    
    rm -f /tmp/active_upgrade
    
    exit 0

    // Oliver

  3. adam says:

    hi Oliver,

    the link you mentioned upper (auth/firmware_upgrade.pl) doesn’t exists any more. I use WDH1NC10000.

    Do you have any idea how I could upgrade the firmware in different way?

    Thanks,
    Adam

  4. Oliver says:

    Hi Adam,

    I’m sorry, no I don’t know what the new URI would look like. Also, the WD MyBook (without network) and the WD MyBook World Edition I had are by now defunct. At least I could scavenge the hard drive from the World Edition – the other one was completely gone.

    // Oliver

Leave a Reply

Your email address will not be published. Required fields are marked *