How to mount WebDav filesystem on Mac?

8

1

Trying to do the following:

mkdir /Volumes/temp
mount_webdav davs://myusername@webdav.yandex.ru:443 /Volumes/temp

It doesn't return any error, but /Volumes/temp is empty in result.

Here are the details of connection required (mac / linux), they are in Russian, but you may see details on screenshots.

Upd. The following works:

mount_webdav -i https://webdav.yandex.ru:443 /Volumes/temp

But in this case I have to input user name and password. I've tried the following:

mount_webdav https://myusername:mypass@webdav.yandex.ru:443 /Volumes/temp
mount_webdav -s https://myusername:mypass@webdav.yandex.ru:443 /Volumes/temp

It doesn't work.

LA_

Posted 2014-01-09T15:07:10.133

Reputation: 536

Answers

4

In (at least) 10.9 and 10.10, mounting via WebDAV via the command line isn't easy -- the mount_webdav command does not work the way it is documented and fails silently leaving an empty mount point while the interactive version (-i) of the command works as expected. The non-interactive version files (specifically storing and retrieving of the login/password).

Here is a solution: https://github.com/childrss/webdav

Matt Childress

Posted 2014-01-09T15:07:10.133

Reputation: 41

3

The correct way to mount a WebDAV-enabled server directory in OS X is like the example you mentioned works. The reason it's asking for a username and password is because you've specified the -i argument, which denotes Interactive mode (you are prompted for the username and password).

To mount a webdav for a certain user you would use like this:

mount_webdav https://webdav.yandex.ru/username/ /Volumes/temp/

If you don't want to be prompted for the username and password then you can store the user credentials in your keychain.

see Apple's MOUNT_WEBDAV man page for more information.

l'L'l

Posted 2014-01-09T15:07:10.133

Reputation: 1 840

I looked for the documentation you are referring to when was trying (that is why I've used option i). But it says nothing about keychain. I've just tried to use your approach, but it didn't help. It asked for permission to use keychain when I tried to connect first time, but the connection again wasn't created. – LA_ – 2014-01-10T18:37:26.917

@LA_, how do you mean the connection wasn't created? it didn't connect, or save the connection? and did you try it with the port added also? – l'L'l – 2014-01-10T19:16:33.997

1Unfortunately, mount_webdav doesn't return any result in both cases when connection is established and when it is not. So, each time I check the result by verifying content of /Volumes/temp. So, after command execution, /Volumes/temp was empty. I've tried with port number and without, https and http. – LA_ – 2014-01-10T19:55:44.030

@LA_, are the login credentials being stored in the keychain and being used for the connection? from what you're describing it almost appears as if it's not. – l'L'l – 2014-01-10T20:05:11.383

I do not know how to check if they are really used, but when I try to connect, OSX asks my permission to use the keychain data. – LA_ – 2014-01-11T07:32:55.437

Btw, when I input url with the port number in the keychain, port number is automatically deleted after record saving. – LA_ – 2014-01-11T07:36:52.670

Here is some instruction how to pass login and name to mount_webdav - http://hints.macworld.com/article.php?story=20020207214002198&query=mount_webdav, but I can not understand it :(

– LA_ – 2014-01-11T08:01:09.483

1

You can also use something like ExpanDrive that has a graphical interface and helps you set up and maintain the webDAV mount. Faster, too, and has some extra features.

hemancuso

Posted 2014-01-09T15:07:10.133

Reputation: 11

Sounds good. What are the extra features that you use? Can you give an example of how to use the mount feature? – HackSlash – 2018-04-18T23:22:10.450

There is other tools in the App Store these days too: ocsmount, Mountain Duck, Transmit, Forklift.

– guruz – 2019-06-19T14:44:22.200

0

I was looking for a solution to make automatic downloads through a command-line script connecting to a WebDav filesystem and found an open source software (for Mac and Windows) which really helped!

Cyberduck: https://cyberduck.io/

It provides both graphical user-interface and command-line options.

clami219

Posted 2014-01-09T15:07:10.133

Reputation: 375