Accessing the NAS from internet (as a local hard drive)

Hello,

I just bought the WD My Cloud and until now I’m quite happy with it. I installed transmission (with a tutorial found on this forum, I have a v4+ firmware) and now I can even download my files directly on the WD My Cloud :slight_smile: With no-ip and port forwarding, I can even access the NAS through SSH from internet.

On my iphone and from internet, I can explore all the photos stored on my nas with the WD Cloup app. However, on my Mac I’d prefer to directly go through my files with the finder and this is not possible when not connected directly on the local network. 

Is there a way to achieve that ? I want my NAS be recognized as a local hard drive even if I am connected on the internet. Can it be done in a simple and free way with an application ? 

Thank you.

Franck.

Hi Francky17, welcome to the WD Community. Have you tried to map the My Cloud form the wd2go site? Check the link below for the steps.

How to remotely access a WD My Cloud Personal Cloud drive

Hello. Thank you for you answer, I already use the WD My Cloud App to access from the Internet to my files. But I’d like to implement a new solution and bypass the WD servers if that is possible (even if not officialy supported).

Hello,

I finally managed to connect to the device remotely through WebDAV (which is better integrated in the Mac OS than the FTP Protocol) by typing: 

htdigest /etc/nas/apache2/auth/htpasswd ‘DeviceUser’ newuser

newuser is the login. 

Is this a correct and long-lasting way to access to my device remotely without going through the WD’s servers ? 

Thank you. 

Adding the newuser is not enough. You’ll also need to add into the htgroup, enable directory listings. A better approach is to create a new settings, see here http://community.wd.com/t5/WD-My-Cloud/enable-webdav/td-p/835463

Thank you for tour post. What is the point or doing these two additionnal steps?

At first, I followed the guide (which seems to do what you say) : http://mybookworld.wikidot.com/forum/t-338804/another-webdav-tutorial, but apache2 was unable to restart and I went back to my original configuration to make it work again.

I then gave an other shot by simply adding a new user and it seems to work. However, if that is not clean i would like to do better.

May you please give me further instructions regarding the commands I have to enter for that? The steps followed by the user in your link are not so clear, as he seems to have done things from several guides. Thank you.

Don’t completely follow the guide from mybookworld. Our nas already has WebDav enabled.

What the other user, @alirz1 did was to create a new config file in the path /etc/apache2/conf.d/. eg. wdnas5080.conf

I’m just copying part of his example here, credit to him:

Listen 0.0.0.0:5080

<VirtualHost *:5080>
ServerAdmin webmaster@localhost

DocumentRoot /shares

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

Alias ​​/webdav /shares

<Location /webdav/>

Dav On
Options Indexes
Order Deny,Allow
Deny from all
Allow from all
AuthName DeviceUser
AuthType Digest
AuthDigestDomain /webdav
AuthDigestProvider file
AuthUserFile /etc/nas/apache2/auth/htpasswd
AuthGroupFile /etc/nas/apache2/auth/htgroup
Require valid-user
</Location>
</VirtualHost>

Enable the auto index for directory listing, run: a2enmod autoindex;

Then restart Apache2, run: service apache2 restart;

Access via: http://wdmycloud:5080/webdav/

Note if you’re adding your own username to WD’s htpasswd (htdigest /etc/nas/apache2/auth/htpasswd ‘DeviceUser’ newuser), you also need to append that “newuser” to the existing group in the htgroup file that holds the access to the share. This is as per require.inc file configurations.

Thank you for your answer.

I did what you wrote, and indeed now I can access via Webdav through http://wdmycloud:5080/webdav/, but only with the username/password I previously created with :

htdigest /etc/nas/apache2/auth/htpasswd ‘DeviceUser’ newuser

Another way is to access through the login/username read in /usr/local/nas/orion/orion.db with sqlite3 (as mentionned in your post in the topic :  http://community.wd.com/t5/WD-My-Cloud/Accessing-the-NAS-from-internet-as-a-local-hard-drive/td-p/838730). But if my understanding is correct, these hashed password change if a modification is performed on the UI → so this way of accessing the NAS via WebDAV does not interest me. 

I guess I need to append the newuser I create with htdigest to the the corresponding groups, but I don’t know how to that.

Lets say that I have a user called ‘franck’ (created in the WebUI) which has full access to /DataVolume/shares/Private and of course /DataVolume/shares/Public. 

I want to create a login/password which has the rights of ‘franck’ : webdavuser1

I want to create a login/password which has the rights of the guests (i.e /DataVolume/shares/Public) : webuser2

How can that be done ? 

Thank your for your time :slight_smile:

aahhh yes…Webdav again!! i went through some pain in getting that to work. But as @Nazar78 pointed out, at the end it turned out be pretty simple.

Now what you are trying to do i.e to somehow keep the rights of a user in check, that is something i was not concerned with.

You migth have to play around with user permission as in Linux in general to allow certain “webdavuser” access to a certain share.

Note that by default, my user ‘newuser’ added with htdigest has access to all shares (even /DataVolume/shares/Private), so that is quite problematic :/ 

In the new custom config, you need to include and define all the access similar to “require.inc”. But then this manual work.

I think to have this fully automated from the dashboard, you’ll need to modify the php and shell scripts codes to insert the original username on top of the ID together with its group. Note Php APC and Opcache is active. So you’ll need to clear the cache everytime you modify the scripts. I have no time to look into all these.

I don’t want that to be automated from the dashboard.

Actually I don’t know how to handle it manually. Should I add the content of require.inc to the config wdnas5080.config ?

Yes you could use the include directive to use the permission from require.inc in the new config.

Thank you Nazar78 for your support, that works as expected :slight_smile:

No problem, glad it helps…