File /etc/davfs2/secrets has wrong permissions

I am trying to mount webdav cloud storage
I installed davfs2

opkg update
opkg install davfs2

here is /etc/davfs2/davfs2.conf

dav_user nobody
dav_group nogroup
cache_dir /tmp/davfs2
cache_size 4
use_locks 0

Here is /etc/davfs2/secrets

davs://maymailaccount@webdav.cloud.mymail.com:443 mysecurepassword

I was thinking that in OpenWRT all operations are performed by root
so when I executed command

mount.davfs https://webdav.cloud.mymail.com /mnt/motion_pics

I was surprised to see message

file /etc/davfs2/secrets has wrong permissions

How do I fix it properly? I can

chmod -R 777 /etc/davfs2/secrets

But is it OK?

Thank you

P.S. Ah, yes, here is permissions for /etc/davfs2

root@OpenWrt:/etc/davfs2# ls -l
-rw-r--r--    1 root     root           237 Mar 31 01:18 davfs2.conf
-rw-r--r--    1 root     root            67 Mar 31 01:17 secrets
root@OpenWrt:/etc/davfs2#


I think /etc/davfs2/secrets must only be readable by root. So to fix your problem should be:

chmod 600 /etc/davfs2/secrets
2 Likes

Thank you, I will try your solution

It worked. At least now it asks for username and password, yet I specify this info in Secrets file
UPD: I managed to start mount command with no errors, yet now it says thet there is no folder to mount despite the fact that folder exists:

drwxr-xr-x    2 root     root          4096 Mar 31 02:48 motion_pics
mount webdav.cloud.mymail.com /mnt/motion_pics
mount: mounting webdav.cloud.mymail.com on /mnt/motion_pics failed: No such file or directory

I must also do something with permissions?