Sei sulla pagina 1di 13

FAQ

Login with SSO

Forum
Quick Links

Forum

Activity Page

Please read before SSO login

Forum Community

Ubuntu Community

The Ubuntu Forum Community

Other Support

Social Media

Ubuntu Ocial Flavours Support

Advanced Search
Useful Links

Networking & Wireless

[SOLVED] Accessing the WD My Cloud via NFS Part 1

Gaining Ubuntu membership is easy. The Ubuntu Membership via Forums


contributions wiki page covers all the potential questions any applicant might have
and a tutorial for the Code of Conduct signing assistant, complete with screenshots,
has been created to make it as easy as possible.
Results 1 to 10 of 21

Page 1 of 3 1 2 3

Last

Thread Tools

Display

Thread: Accessing the WD My Cloud via NFS Part 1


Like Bethefirstofyourfriendstolikethis.

#1

October 6th, 2014

Scooby-2
Just Give Me the Beans!

Join Date:
Jul 2011
Location:
Spain
Beans:
80
Distro:
Ubuntu 14.04 Trusty Tahr

Accessing the WD My Cloud via NFS Part 1


The WD My Cloud supports NFS by default and the server itself needs only one conguration le to be
changed in order to work correctly with Linux clients running NFS.
This how-to shows you what you need to do to add a user to the My Cloud, add a private share to the server
and enable access to it via NFS. I have tried to make it as easy as possible for people who are not comfortable
editing les from the command line by using commands which can (with one or two exceptions) be copied
and pasted.
Edit 2 Nov 2014: This tutorial is applicable regardless of the client OS, be it Windows, OSX, Linux, Solaris, AIX,
Haiku or whatever. However you need to know how to access the WD My Cloud UI (for which I recommend
reading the WD documentation) and how to run a terminal session from that OS.
Edit 3 May 2015: Changed some of the quotes text to code, as spurious spaces are added by the forum software.
Please note that following these instructions will entail running commands as root on the WD My Cloud. Be
warned that it is VERY easy to brick your server by running commands as root. I accept no responsibility for
anyone who manages to brick their system(s) following this guide.
1. If the user you want to use has already been dened, skip to step 3. To add a new user to the server use
the the UI. After logging in, click Users (1 in the screen print), then the Add User button (2):

2. In the Add User box, enter the desired user name. I suggest using the same user name on the Linux system
that you want to be able to connect to the server. This is the only required eld, the others may be left blank.
However, for security, you may wish to assign a password (this would be used if you were to connect using
SMB). Type in the required user ID - in my example I am adding a user called janm. Click the Save button.

3. If the share you want to use already exists, skip to step 5. Otherwise click on Shares (3 in the screen print
below) the Add Folder button (4).

4. Add the folder name that you wish the user to see when they look for their private folder in File Manager.
This is the only required eld. Click Save.

5. Turn o Public Access and enable full access for the new user as shown below.

6. Turn on SSH by clicking on Settings (5), Network (6) and then SSH (7). Set it to on (if it isn't already).

7. To log in to the server via SSH, from the client open a terminal window and type
Code:

sshroot@
{
IP_OF_YOUR_SERVER}

If you see something like this:

The authenticity of host 'nas (xxx.xxx.xxx.xxx)' can't be established.RSA key ngerprint is


12:34:56:78:90:AB:CD:EF:00:11:22:33:44:55:66:77.
Are you sure you want to continue connecting (yes/no)?

Answer yes. You are getting this message because it the rst time you are connecting via SSH. You should
then see

Warning: Permanently added 'nas,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.

and you will be prompted for the root password of the NAS server. Type your root password, or if you haven't
ever changed it, type welc0me. If you are logged on using the default password CHANGE IT NOW by typing
Code:

passwd

and enter a new one.


8. We now need to modify the le responsible for managing the exports on the server. There are two ways to
do this - method one is best for inexperienced users, where the le is created on the client using your
favourite text editor. Method two is ne if you are comfortable running commands as root on the server (see
warning above).
Method 1. Log in to the server and run the following commands to back up and write protect the original le:
Code:

cd/etc

Code:

cpexport
sexports.orig

This copies your original le in case you mess up and need to restore it.
If you are asked if you want to overwrite exports.orig answer no. It probably means you are running through
this for the second time and answering yes will overwrite your original le. Seek advice...
Code:

chmod400exports.orig

This command makes the copy read-only, so you will get the prompted before it will be overwritten (see
above)/
On your Linux client, open your favourite text editor and create a le named exports with the following text:

Code:

#Usenob
o
dyuser(uid65534)fornf
sg
u
es
t. T
hi
sisr
es
tr
ict
edf
ro
mpr
iv
ate
#sharesb
yACLs.
#
/nfs/Publ
i
c*(rw,all_squash,sync,n
o_
sub
t
re
e_
che
ck
,i
ns
ec
ur
e,
cro
ss
mn
t,
an
on
ui
d=6
55
34
,
an
o
ng
id
=1
0
0
0)
/nfs/janm*(rw,no_all_squash,sync,
no
_su
b
tr
ee
_ch
ec
k,
in
se
cu
re
,cr
os
sm
nt
,a
no
nu
id=
65
53
4
,a
n
on
gi
d=
1
0
00
)
#Replacejanmwiththeusernameyo
uc
r
ea
te
di
nst
ep2
.

Save the le in your home directory.


In the terminal window, log out of the server so you are working on your client and type the following:

cd

and then

rcp exports root@xxx.xxx.xxx.xxx:/etc/


(# Replace xxx.xxx.xxx.xxx with your NAS server's IP address)

The rcp command stands for remote copy, and allows les to be transferred over the network via SSH.
Go to step 9.
Method 2. Log in to the NAS server via SSH. Copy and paste the following lines (paste is available from the
menu in terminal) ONE AT A TIME .
Code:

cd/etc

Code:

cpexport
sexports.orig

If you are asked if you want to overwrite exports.orig answer no. It probably means you are running through
this for the second time and answering yes will overwrite your original le. Use method 1 instead.
Code:

chmod400exports.orig

Code:

sed-i's
:
^/nfs:/nfs/Public:'expo
rt
s

Code:

newid=jan
m
#INSTEADOFjanmTYPETHENEWUSE
RN
AMEYO
UCHO
SEA
BO
VEI
NSTE
P2AB
OV
E.

Code:

echo"/nf
s
/$newid*(rw,no_all_squa
sh
,sy
n
c,
no
_su
bt
re
e_
ch
ec
k,
ins
ec
ur
e,
cr
os
sm
nt,
an
on
u
id
=
65
53
4,
a
n
on
g
i
d=

What we are doing here is:


Changing directory to /etc
Copying the exports le to one called exports.orig
Making the copy read only, so it will not be overwritten without a prompt.
The next line appends /Public to the line which starts /nfs. This is so the the Public directory will be available
to everyone.
The newid.... line just sets a variable which is used below.
This line echoes the text and appends it to the exports le, adding /nfs/{newid}. The bunch of text after that
makes it private to the new user.
Here it is in action:

9. From the terminal logged on to the server, to view the updated contents of the exports le type
Code:

cat/etc/
e
xports

and you should see this, except the username on the last line should match what you entered:

I am only permitted to use 8 images per post, so this post is continued here.
Second edit for clarication and add the option to create the new exports le locally, then rcp it to the
server.

Third edit to replace a photo with a typo on the screen and to add a description of what the commands do.
Fourth edit to advise that this tutorial is not OS dependent but users need to know how to access the NAS UI
and also how to start ssh in a terminal session.
Last edited by Scooby-2; May 12th, 2015 at 10:05 AM. Reason: Added link to part 2

Adv Reply

Reply With Quote

#2

November 20th, 2014

Join Date:
Nov 2014

Palindar
First Cup of Ubuntu

Beans:
1

Re: Accessing the WD My Cloud via NFS Part 1


This is a great guide, thanks Scooby-2! I am teaching myself linux and I am trying to understand in detail the
steps you describe. I am stuck at one line though and it would be great if you can point me in the right
direction.

/nfs/janm *(rw,no_all_squash,sync,no_subtree_check,insecure,
crossmnt,anonuid=65534,anongid=1000)

After adding this line, I would think that it does not matter which user is accessing the share but yet your
instructions further down require uid's to be identical on server and client. Why is that?

Adv Reply

Reply With Quote

#3

November 20th, 2014

Join Date:
Jul 2005

zaphod_es
5 Cups of Ubuntu

Location:
Brazil
Beans:
25
Distro:
Ubuntu 12.04 Precise Pangolin

Re: Accessing the WD My Cloud via NFS Part 1


This looks to be a great post and I am sure it is going to help me get my new WD NAS congured the way I
want it.
My rst problem is all those screenshots. What app are you running or is it in Windows or running in Linux
under WINE ?
Until I can allow ssh there is no way I can do much and I cannot work out how to do that in my Linux only
house.

Adv Reply

Reply With Quote

#4

#4

November 21st, 2014

Join Date:
Jul 2011

Scooby-2
Just Give Me the Beans!

Location:
Spain
Beans:
80
Distro:
Ubuntu 14.04 Trusty Tahr

Re: Accessing the WD My Cloud via NFS Part 1


@Palindar
I tried to keep the instructions as simple as possible without going deep into every point. Adding the user
and share from the UI, which is detailed in the rst 5 steps, gives ownership of the new share to that user.
Hence they will be exported with that user's UID (NFS works with UIDs, not user names). As it can only be
mounted by a user on a remote system who has the same UID it follows that a user who has a dierent UID
(but may even have the same user name) will get "Permission denied" when they try to mount it.
@zaphod_es
I am running Teminal in Linux but you an also use Putty for Windows (it's free).

Adv Reply

Reply With Quote

#5

November 21st, 2014

Join Date:
Jul 2005

zaphod_es
5 Cups of Ubuntu

Location:
Brazil
Beans:
25
Distro:
Ubuntu 12.04 Precise Pangolin

Re: Accessing the WD My Cloud via NFS Part 1

@zaphod_es
I am running Teminal in Linux but you an also use Putty for Windows (it's free).

My problem is that I cannot nd how to access the device from the Terminal in Linux. This is becuase the ssh
server has not been authorised. I do not have Windows.
To authorise the shh server I need the UI shown in the rst 5 steps. Can I get that without Widnows or Mac?

Adv Reply

November 21st, 2014

Scooby-2
Just Give Me the Beans!

Reply With Quote

#6
Join Date:
Jul 2011
Location:
Spain
Beans:

80
Distro:
Ubuntu 14.04 Trusty Tahr

Re: Accessing the WD My Cloud via NFS Part 1


@zaphod_es

My problem is that I cannot nd how to access the device from the Terminal in Linux. This is
becuase the ssh server has not been authorised. I do not have Windows.
To authorise the shh server I need the UI shown in the rst 5 steps. Can I get that without
Widnows or Mac?

From the Linux terminal, type


Code:

sshroot@
{
ip_address_ofyour_WD_NA
S}

e.g.
Code:

sshroot@
1
92.168.1.22

Have a look at this.


This is not relevant to this tutorial so I suggest you research further on the Internet rather than post here. If
you have big problems feel free to pm me.

Adv Reply

Reply With Quote

#7

November 21st, 2014

Join Date:
Jul 2005

zaphod_es
5 Cups of Ubuntu

Location:
Brazil
Beans:
25
Distro:
Ubuntu 12.04 Precise Pangolin

Re: Accessing the WD My Cloud via NFS Part 1


I am an experienced Linux user and routinely use ssh to connect to remote servers. The problem is that the
ssh daemon is not running on the NAS device and I need to know how to start it from a Linux box.
The tutorial is on ubuntuforums.org and my question (in the original post and repeated in the second) is how
do you access the UI in Ubuntu. If this were a tutorial for Windows or Mac users the question might not be
relevant but in a Linux forum is 100% on topic. Surely it is not too dicult to tell me what OS and or program
you used in the UI screen shots. If the answer is that you did it in Windows and don't know how to do it in
Linux: just say so.

Adv Reply

Reply With Quote

#8

November 22nd, 2014

Join Date:
Jul 2011

Scooby-2
Just Give Me the Beans!

Location:
Spain
Beans:
80
Distro:
Ubuntu 14.04 Trusty Tahr

Re: Accessing the WD My Cloud via NFS Part 1

Originally Posted by zaphod_es

I am an experienced Linux user and routinely use ssh to connect to remote servers. The problem is
that the ssh daemon is not running on the NAS device and I need to know how to start it from a
Linux box.
The tutorial is on ubuntuforums.org and my question (in the original post and repeated in the
second) is how do you access the UI in Ubuntu. If this were a tutorial for Windows or Mac users the
question might not be relevant but in a Linux forum is 100% on topic. Surely it is not too dicult
to tell me what OS and or program you used in the UI screen shots. If the answer is that you did it
in Windows and don't know how to do it in Linux: just say so.

Step 6 above tells you how to start the ssh daemon. I used Ubuntu 14.04 LTS to obtain the screenshots.

Adv Reply

Reply With Quote

#9

January 9th, 2015

Join Date:
May 2012

cmfelix
First Cup of Ubuntu

Beans:
1

Re: Accessing the WD My Cloud via NFS Part 1


Thanks for the tutorial, works great! I have a couple of questions about server/client uuid's. In my case I have
several windows boxes that also mount Public and a private share from the same My Cloud being used from
my Lubuntu box using the same name on all clients, lets just say, noob. I tried to adjust noob's uuid on the
server side to match noob's uuid on the Lubuntu NFS client, per your suggestion, but it then blocked noob's
access to the private share on Windows. I could only get Windows access again by going back to the uuid as it
was before enabling the NFS procedure on the Lubuntu box. As expected, the Lubuntu client now doesn't
allow noob's access to the private share. Since you indicated there could be complications in changing the
existing client side uuid and the noob user name is the one I provided at installation time, I am considering reinstalling Lubuntu with a user name like "install", then adding in noob after the installation is done when I
could specify noob's uuid from the My Cloud. Would you expect that might alleviate any issues regarding
making changes to noob's uuid, especially if it was the name used for installation? Or do I really need to use
the install user name on a regular basis and I should continue to install w/noob and try to change the uuid
post-install?

Adv Reply

January 9th, 2015

Reply With Quote

#10

Join Date:
Jul 2011

Scooby-2
Just Give Me the Beans!

Location:
Spain
Beans:
80
Distro:
Ubuntu 14.04 Trusty Tahr

Re: Accessing the WD My Cloud via NFS Part 1

Originally Posted by cmfelix

Thanks for the tutorial, works great! I have a couple of questions about server/client uuid's. In my
case I have several windows boxes that also mount Public and a private share from the same My
Cloud being used from my Lubuntu box using the same name on all clients, lets just say, noob. I
tried to adjust noob's uuid on the server side to match noob's uuid on the Lubuntu NFS client, per
your suggestion, but it then blocked noob's access to the private share on Windows. I could only
get Windows access again by going back to the uuid as it was before enabling the NFS procedure
on the Lubuntu box. As expected, the Lubuntu client now doesn't allow noob's access to the
private share. Since you indicated there could be complications in changing the existing client side
uuid and the noob user name is the one I provided at installation time, I am considering reinstalling Lubuntu with a user name like "install", then adding in noob after the installation is
done when I could specify noob's uuid from the My Cloud. Would you expect that might alleviate
any issues regarding making changes to noob's uuid, especially if it was the name used for
installation? Or do I really need to use the install user name on a regular basis and I should
continue to install w/noob and try to change the uuid post-install?

@cmfelix
I wrote the procedure to help anyone wanting to use NFS and Linux to access the WD My Cloud. I suggest you
start a new thread asking for help with your problem. I am not familiar with using NFS on Windows so I
cannot tell you how to modify the UUID it would use to access a server.

I am considering re-installing Lubuntu....

The words "sledgehammer" and "nut" spring to mind. I really don't think this should be necessary. I doubt it
would solve your problem anyway.

Adv Reply

Reply With Quote

Page 1 of 3 1 2 3
Quick Navigation

Last

Networking & Wireless

Previous Thread | Next Thread

Tags for this Thread


conguration, nas access, nfs client, wd my cloud
View Tag Cloud

Bookmarks

Posting Permissions

StumbleUpon

You may not post new threads


You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
[VIDEO] code is O

Google

HTML code is O

Digg
del.icio.us

Top

Google

HTML code is O
Ubuntu Forums Code
of Conduct

Ubuntu Forums Archive Top

UbuntuvB4.x

All times are GMT +1. The time now is 08:08 PM.
vBulletin 2000 - 2016, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical Canonical Ltd. Tango Icons Tango Desktop Project.
User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License. For details and our
forum data attribution, retention and privacy policy, see here

Potrebbero piacerti anche