[clug] Hosted Office 365 - Sharepoint - Linux - rsync

George at Clug Clug at goproject.info
Sun Mar 1 00:15:16 MST 2015


    (to add a little more info)

Our company uses hosted Office 365 and I would like to automatically
and routinely back up files to a Linux server, say each night.

Does anyone else do this activity ?  I will guess I am the only
person wanting to do so.

My research suggested to map a share using webdav and then use rsync
to copy the files to the linux backup computer.



# apt-get install davfs2

# dpkg-reconfigure davfs2
# lsmod | grep coda
# modprobe coda
# cat /etc/modules
# echo coda >> /etc/modules
# lsmod | grep coda

I then tried to mount the Sharepoint site using;
# mount -t davfs "https://mydomain.sharepoint.com/site1name/" 
/mnt/mysite1name
and I have tried using;
mount -t davfs "https://mydomain.sharepoint.com/site1name/" -o
uid=root,gid=root,dir_mode=777,rw  /mnt/mysite1name

When prompted for user name and password I have tried the following;
User.Name at mydomain.onmicrosoft.com

and

mydomain.onmicrosoft.com\\User.Name

The error message after entering username and password is;
/sbin/mount.davfs: Mounting failed.
403 FORBIDDEN


The above works well to mount my own webdav server, but not for
sharepoint, I believe the issue is related to "Your sharepoint-server
may use windows-authentication. The neon-library used by davfs2
supports NTLM and Kerberos. But you will have to set up your system to
enable these authentication shemes to be used by neon".
http://sourceforge.net/p/dav/discussion/82589/thread/4c7c199c/

http://howto.unixdev.net/Linux-SharePoint.html

I turned on debug most and found this in the syslog
Mar  1 17:54:15 co2kvm1 mount.davfs: [hdr] X-MSDAVEXT_Error: 917656;
Access+denied.+Before+opening+files+in+this+location%%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
Mar  1 17:54:15 co2kvm1 mount.davfs: Header Name: [x-msdavext_error],
Value: [917656;
Access+denied.+Before+opening+files+in+this+location%%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.]
Mar  1 17:54:15 co2kvm1 mount.davfs: [hdr] X-IDCRL_AUTH_PARAMS_V1:
IDCRL Type="BPOSIDCRL", EndPoint="/_vti_bin/idcrl.svc/",
RootDomain="sharepoint.com", Policy="MBI"
Mar  1 17:54:15 co2kvm1 mount.davfs: Header Name:
[x-idcrl_auth_params_v1], Value: [IDCRL Type="BPOSIDCRL",
EndPoint="/_vti_bin/idcrl.svc/", RootDomain="sharepoint.com",
Policy="MBI"]

http://community.office365.com/en-us/f/154/t/214997.aspx 
The user receives this error because the session cookie for SharePoint
Online has expired and must be “refreshed” in order to
successfully access the mapped network drive again. 

Presently this behavior is by design. We are trying to improve it. If
there is any updates, we will inform you.



http://forums.linuxmint.com/viewtopic.php?f=195&t=107705
http://serverquestions.com/questions/h7za/mount-sharepoint-online-office-365-in-linux
http://superuser.com/questions/851483/mount-sharepoint-online-office-365-in-linux

http://sharepoint.stackexchange.com/questions/50022/mounting-a-sharepoint-filesystem-on-linux-using-davfs2
http://stackoverflow.com/questions/9871270/mounting-webdav-shares-using-davfs2

http://osdir.com/ml/general/2012-04/msg26730.html
However, in newer versions of davfs2, support for NTLM authentication
is only
available when using libneon linked with openssl. This means I am
unable to
mount my Sharepoint folders made available via WebDAV, instead seeing
the error
message "Could not authenticate to server: ignored NTLM challenge".
Rebuilding
davfs2 using libneon27 instead of libneon27-gnutls solves this
problem.

Please consider switching davfs2 back to use libneon27.




More information about the linux mailing list