Enable SSH on your new WD Mybook
Forum » Forum / My Book World Edition (blue rings) » Enable SSH on your new WD Mybook
Started by: fraterfrater
On: 1213533526|%e %b %Y, %H:%M %Z|agohover
Number of posts: 25
rss icon RSS: New posts
Enable SSH on your new WD Mybook
fraterfrater 1213533526|%e %b %Y, %H:%M %Z|agohover

The following step-by-step is for newbies who can't get in using the other tutorials.
It's not because the other tutorials are wrong, it's because new users confuse the different credentials that are being used.
Let's start and open up this box.

Login to your WDMB with your Internetbrowser by typing in its IP.
My Worldbook's IP is 192.168.10.210. I will give that in the examples.
Of course you have to replace it by your own IP.

Use the default account: admin/123456
Leave "admin" as your login name, but change its password to something only you know.

If you want you can upgrade to the latest firmware.
Although the latest firmware doesn't have GCC and NFS I still advise you to do this. Your mybook will accept more commands and GCC and NFS can be added afterwards quite easily.

Anyhow… If you want the latest firmware then do it now.
if you do it later, all your hacks will be gone (this might be a good thing if you want to experiment first)
All the extra programs you can install after hacking it (like bittorrent-client, uPnP-server, CUPS, PHP) will be gone as well…
You will NOT lose the data on your shares…..

You are now in your worldbook as admin.
You can create shares and users.

Still using the webinterface, Create a filesharing user named WORLDBOOK with password WORLDBOOK.

Apply Martin Hinner's patch by putting this address in your browser (the IP of YOUR worldbook of course)
http://192.168.10.210/auth/firmware_upgrade.pl?fwserver=martin.hinner.info/mybook/firmware.php

You might get an error message here saying "Firmware failed to download - try later" but you should continue anyhow and try to gain access using ssh

SSH (secure shell) is now enabled and the root account has no password.
Because root has no password, you can't login directly as root. You will have to use the credentials of a user created under "filesharing" and use only CAPITALS.

This is one of the pitfalls. You CAN NOT use the admin account. The admin account has no SSH-access.

So login using WORLDBOOK as username and password. (You can use putty, if you have Windows)

ssh 012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW
012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW's password: WORLDBOOK
ssh Could not chdir to home directory /home/WORLDBOOK: No such file or directory

you're in now, but as the restricted user WORLDBOOK.
Now login as root… No password is needed. This has been removed by Martin Hinner's script.

su -

You will see the prompt change into: [root@mybook ~]#
Which means you are logged in as root on the host mybook and you're standing in your home directory (~)
Now you should change the password of the user root.
root is the linux "super user" with all rights.
When the root-account has a password, you'll be able to login directly as such.

passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
mylittlesecret
Bad password: too weak.
Re-enter new password:
mylittlesecret
Password changed.

You can now login as root with your password. No need to login twice each time.
You should test this!

SSH will get disabled again after a reboot.
To change this, you have to modify the config of inetd. The line is already there, you only need to remove the #.

vi /etc/inetd.conf
ssh stream tcp nowait root /usr/sbin/sshd sshd -i

If "vi" the standard editor in Unix gives you too much hassle you can add this extra line in a quick and dirty way. (Do take the time to learn the basic commands of vi. It's on almost every linux distro.)
echo "ssh stream tcp nowait root /usr/sbin/sshd sshd -i" » /etc/inetd.conf

To enable access with an ssh-key (recommended but maybe for the future) you can login without a password using a private key. If you have a private/public key-pair you can use it by putting your login key in the right place (~/.ssh):

mkdir ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIB2yhsJkngVBGazm95UdWa7gyfkv7KXw7JPgrNSMe7l5wGFdpemSq2NFTZUkiCMrMhdAPuE/BfonpcTaUH9gnKT1IGU/ZMsEs8gGUlvfKD4VZT//7sZoNYkbcVXETUsQfqulWoAXp1UppqzmfjVMEuCVhd6iH9beYIERiYIEyH57Q== rsa-key-20060420" >> ~/.ssh/authorized_keys

This is of course my public key. You'll need to generate one of your own, but that's a different topic.

After you established that, you can login using your root account. Give it a reboot and check if it still gives you access through SSH.
Using the webinterface you can safely delete the user WORLDBOOK after that.

If you lost your password somehow, you can re-enable Martin Hinner's patch to remove password of the root. You need the admin's password for that. If you lost that too, you can regain that one by using the paperclip. Afterwards the account is admin/123456 again.

The next thing to do is install optware……

Last edited on 1222667856|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Reply  |  Options
Unfold Enable SSH on your new WD Mybook by fraterfrater, 1213533526|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
speperspeper 1213585258|%e %b %Y, %H:%M %Z|agohover

Thanks Frater,

For this wonderful how to do steps for the newbie.

Regards

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by speperspeper, 1213585258|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
alephsmithalephsmith 1213585819|%e %b %Y, %H:%M %Z|agohover

It's great that someone has finally written a step-by-step procedure for this. I have one suggestion: put the terminal commands in code blocks using the [[code]][[/code]] tags. This might make things a little easier to read.

I know you probably didn't use this method but there is a cleaner method available here: http://www.mybook-linux.co.nr/sshaccess.html
This uses the root account and negates the need to create a new user. I think that using this alternate hack would reduce some of the hassles that people have been having with getting ssh access.

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by alephsmithalephsmith, 1213585819|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1213597696|%e %b %Y, %H:%M %Z|agohover

I can't use Bold and italics within the code block to differentiate between commands the user types and the response of WDWB
Most users have already tried Martin Hinner's patch before reading this procedure.

Along the way new users learn some commands…

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1213597696|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
alephsmithalephsmith 1213603853|%e %b %Y, %H:%M %Z|agohover

Well I guess it is up to you. I usually try to put a # to indicate when a command has been entered at the prompt.

As for what script people use, hopefully now that the alternate script is visible on the first-steps-with-mbwe page more people will use it.

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by alephsmithalephsmith, 1213603853|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
melbdeanmelbdean 1213587974|%e %b %Y, %H:%M %Z|agohover

thank you Frater! you have just provided the crucial point of difference from all 4 other versions of how to do this first and most basic of steps. i have been trying all of them for weeks without success.
(although I would like to give a special mention to alephsmith for all the assistance provided trying to work out where i went wrong).

the KEY message in your step-by-step that is clearer than any of the others (or at least is clearer to me), is that you can't log in via the admin account -it must be by the new user.

Now all I need to know is:
do you need to be logged in to the webpage as the new-user?
if so, how do you log-in to the webpage as the new-user? -mine automatically defaults to the admin user?
if the webpage shows the admin users details, is it still possible to use the newly created username/password via terminal on a macbook?

Thanks,

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by melbdeanmelbdean, 1213587974|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1213597184|%e %b %Y, %H:%M %Z|agohover

There are 3 types of accounts.

admin account: only one account here. It's for accessing the standard webinterface. I recommend leaving the username to admin. If you forget the password, you can get it back to "admin/123456" with a paperclip (read manual).

Filesharing users: You create them using the standard webinterface under the header Filesharing. They are for giving you access to the shares that are created (PUBLIC is already created by default). Those users are all CAPS. No home directory is created in Linux.

Normal Linux users: You create them with adduser or packages create them.

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1213597184|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
PotatoMasherPotatoMasher 1213729908|%e %b %Y, %H:%M %Z|agohover

Can I know which program you are using to access the device?

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by PotatoMasherPotatoMasher, 1213729908|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1213733951|%e %b %Y, %H:%M %Z|agohover

When I'm on a Windows machine I use Putty (WinSCP for filetransfers).
On a linux-machine I just type ssh

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1213733951|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
PaseloPaselo 1225310534|%e %b %Y, %H:%M %Z|agohover

Hello
Sorry about my english… Usually I speak french.

Frater I follow your instruction but I still have a problem.
It's ok for me to log with Putty with the account root and my password. After I change the line like this:

netbios-ssn stream tcp nowait root /usr/local/samba/sbin/smbd smbd -s/etc/smb.conf -l/var/log -d0
#swat stream tcp nowait root /usr/local/samba/sbin/swat swat -a -d 1 -l /var/log
#tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -c -s /tftpboot
ssh stream tcp nowait root /usr/sbin/sshd sshd -i
#telnet stream tcp nowait root /usr/sbin/telnetd telnetd
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
- /etc/inetd.conf 1/5 20%

Everything is ok until here?

Then I apply the Martin's patch but I have a error message. After that I CAN'T log again in Putty with root account.

Do I have to do this part?

vi /etc/inetd.conf
ssh stream tcp nowait root /usr/sbin/sshd sshd -i

If "vi" the standard editor in Unix gives you too much hassle you can add this extra line in a quick and dirty way. (Do take the time to learn the basic commands of vi. It's on almost every linux distro.)
echo "ssh stream tcp nowait root /usr/sbin/sshd sshd -i" » /etc/inetd.conf

To enable access with an ssh-key (recommended but maybe for the future) you can login without a password using a private key. If you have a private/public key-pair you can use it by putting your login key in the right place (~/.ssh):

mkdir ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIB2yhsJkngVBGazm95UdWa7gyfkv7KXw7JPgrNSMe7l5wGFdpemSq2NFTZUkiCMrMhdAPuE/BfonpcTaUH9gnKT1IGU/ZMsEs8gGUlvfKD4VZT//7sZoNYkbcVXETUsQfqulWoAXp1UppqzmfjVMEuCVhd6iH9beYIERiYIEyH57Q== rsa-key-20060420" » ~/.ssh/authorized_keys

This is of course my public key. You'll need to generate one of your own, but that's a different topic.

After you established that, you can login using your root account. Give it a reboot and check if it still gives you access through SSH.
Using the webinterface you can safely delete the user WORLDBOOK after that.

Because I don't understand it very well… How can I had an extra line???

**Thanks to help me

Paselo**

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by PaseloPaselo, 1225310534|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1225311143|%e %b %Y, %H:%M %Z|agohover

If you're able to login with putty, it means you are in.
If you are able to login after a reboot, it means the hack is permanent.

Because I don't understand it very well… How can I had an extra line???

You probably tried some other hacks as well.
Some hacks will remove the # for you…

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1225311143|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
PaseloPaselo 1225351369|%e %b %Y, %H:%M %Z|agohover

Thanks for your answer

I can't login after a reboot… that the problem? no?

When you say after a reboot … which reboot? Computer or WMB?

I tried other crack few week ago…

But I would like to know If I have to do this part?

If "vi" the standard editor in Unix gives you too much hassle you can add this extra line in a quick and dirty way. (Do take the time to learn the basic commands of vi. It's on almost every linux distro.)
echo "ssh stream tcp nowait root /usr/sbin/sshd sshd -i" » /etc/inetd.conf

If "yes" how can I had this line?

Thanks so much because I tried since many week… And I think I'm really near the solution

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by PaseloPaselo, 1225351369|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
PaseloPaselo 1225387393|%e %b %Y, %H:%M %Z|agohover

One step more…

Ok now when I reboot I still have access with the login root. I have access with the putty.

But when I tried to connect in My Worldbook with 192.16.1.7 I only can log with the admin and not with the root…

Is it normal?

Unfold Re: Enable SSH on your new WD Mybook by PaseloPaselo, 1225387393|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1225391636|%e %b %Y, %H:%M %Z|agohover

Yes it is normal that you can't login with root. This is explicitly mentioned in my 'howto'
You can only login with the username/pass of the shares you made.
This is because the user root has no password.
If root has a password, you can directly login.

BTW… Normally you can NOT login with admin

After you login using you username/pass of a share (WORLDBOOK/WORLDBOOK), you can issue the command su -, which will get you in as root.
If you are logged in as root, you should enable its password.

All this info is in my howto. Please read it again and slowly

Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1225391636|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
PaseloPaselo 1225394269|%e %b %Y, %H:%M %Z|agohover

Thank but I think you don't understand my english… that's normal I speak french.

When I use putty I have a password for root and I can log with root. That's ok.

But when I want to log with the web interface to my worldbook. I use 192.168.1.7 and after I have to put a user and a password.
I can only use admin. user root and user WORLDBOOK have no access?

What did I wrong?

Thanks

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by PaseloPaselo, 1225394269|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
melbdeanmelbdean 1226579526|%e %b %Y, %H:%M %Z|agohover

i haven't been using the MyBook for some time. I presumed the successful hack would still be operational so I checked ssh with both terminal and cyberduck. neither app got me unrestricted access. i hard reset the MyBook and followed fraters steps only to face the same problem. following is the sticking point, my steps in bold, fraters cut and pasted from his how-to:

So login using WORLDBOOK as username and password. (You can use putty, if you have Windows)
ssh 012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW's password: WORLDBOOK
ssh Could not chdir to home directory /home/WORLDBOOK: No such file or directory

I logged in with WORLDBOOK username and password (i used terminal on my macbook)
ssh XXX.XX.XXX.XXX|KOOBDLROW#XXX.XX.XXX.XXX|KOOBDLROW
XXX.XX.XXX.XXX|KOOBDLROW#XXX.XX.XXX.XXX|KOOBDLROW's password:
Could not chdir to home directory /home/WORLDBOOK: No such file or directory
[WORLDBOOK@XXXXXX /]$

as you can see, there is an extra line here

you're in now, but as the restricted user WORLDBOOK.
Now login as root… No password is needed. This has been removed by Martin Hinner's script.
su -
You will see the prompt change into: [root@mybook ~]#
Which means you are logged in as root on the host mybook and you're standing in your home directory (~)
Now you should change the password of the user root.
root is the linux "super user" with all rights.
When the root-account has a password, you'll be able to login directly as such.

**When i get to this stage, i don't get the [root@mybook ~]# prompt, rather i get the following:
[WORLDBOOK@XXXXXX /]$

What have I done wrong? No matter what password i try, including no password, I get the following:
[WORLDBOOK@XXXXXX /]$ su -
Password:
su: incorrect password
[WORLDBOOK@XXXXXX /]$ su -
Password:
su: incorrect password
[WORLDBOOK@XXXXXX /]$ su -
Password:
su: incorrect password
[WORLDBOOK@XXXXXX /]$ su -

any/ all help greatly appreciated.**

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by melbdeanmelbdean, 1226579526|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
rcascarcasca 1232098865|%e %b %Y, %H:%M %Z|agohover

Thanks, it works fine.

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by rcascarcasca, 1232098865|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
slayer91slayer91 1222616736|%e %b %Y, %H:%M %Z|agohover

Hello,
I have followed your instructions and have been getting an error and I'm hoping you may be able to steer me in the correct direction.
I have created the new file sharing user and put the link in to d/l the new firmware. I get the new firmware available and click on the button, it tells me that the new firmware is being applied along with the message in red about :

The upgrade process takes approximately 30minutes depending on internet connection speed and general network activity.
THE USER SHOULD NOT ACCESS THE DEVICE UNTIL THE UPGRADE IS COMPLETE
The user must NOT power off the device during the upgrade process.
The user should NOTE, the front panel lights will
flicker during firmware download
extinguish for approximately 15 minutes, whilst applying the firmware
illuminate when firmware upgrade is complete

However, after about 3mins, I get the following message

Firmware failed to download - try later

I have tried numerous times to d/l the new firmware but the same error always occurs. Is ther a problem with the link???

Regards

Liam

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by slayer91slayer91, 1222616736|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
AspirinAspirin 1222630655|%e %b %Y, %H:%M %Z|agohover

Slayer,
I used this method http://www.mybook-linux.co.nr/sshaccess.html to gain access to the device and had the same problem. I found that the update had indeed taken place despite the message that it had failed as ssh works fine. The fact that the system date had reset was the giveaway for me.
Try it yourself and end the frustration :)

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by AspirinAspirin, 1222630655|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1222631357|%e %b %Y, %H:%M %Z|agohover

Ok…
I will update the howto accordingly….

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1222631357|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
slayer91slayer91 1222720312|%e %b %Y, %H:%M %Z|agohover

Hello,

Thanks for the replies, I tried as you suggested and ran putty, it made the connection as it asked me for the login. I entered '511.1.861.291|toor#511.1.861.291|toor'(the device IP address). On the next line it asked for password and I entered 'root'. However, I keeping getting 'Access denied' message.
What am I doing wrong. Please help

Regards

Liam

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by slayer91slayer91, 1222720312|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1222720782|%e %b %Y, %H:%M %Z|agohover

you DID NOT follow my tutorial then…

READ IT

It's quite clear about it.

you should NOT access as root and password is NOT root

Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1222720782|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
AspirinAspirin 1222724322|%e %b %Y, %H:%M %Z|agohover

LOL Frater…can understand the annoyance :)
Thanks for changing tutorial. It maybe worth adding that the time and date reset when the firmware updates successfully. It's only way of knowing without repeated "ssh" connectivity.

Liam, if you follow Frater's tutorial:
ssh 012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW
012.01.861.291|KOOBDLROW#012.01.861.291|KOOBDLROW's password: WORLDBOOK

If you used the alternative method it is user "root" and password "root".

Unfold Re: Enable SSH on your new WD Mybook by AspirinAspirin, 1222724322|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
slayer91slayer91 1222808105|%e %b %Y, %H:%M %Z|agohover

My complete apologies to you. I understand your fustration. Not only did I mix up your instructions but fail to follow them by being lazy!! I did not understand that the name of the acount was linked to the firmware. Because I had already had an username set up, I was using that……. Hence the access denied message. Once I follow your instructions to the letter. it worked fine.

Thanks for your help

Regards

L

Unfold Re: Enable SSH on your new WD Mybook by slayer91slayer91, 1222808105|%e %b %Y, %H:%M %Z|agohover
Re: Enable SSH on your new WD Mybook
fraterfrater 1222820243|%e %b %Y, %H:%M %Z|agohover

No Problemo…
The goal is to get as many as possible inside…. ;-)

Welcome!

Reply  |  Options
Unfold Re: Enable SSH on your new WD Mybook by fraterfrater, 1222820243|%e %b %Y, %H:%M %Z|agohover
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License