How to mount webdav folder with systemd and TOTP?

Hi all,

I use systemd to mount my NC webdav, when I need it and unmount, when I don’t.
Works perfectly fine, but not with TOTP enabled :frowning:

This is my /etc/systemd/system/cloud.domain.tld.mount:

[Unit]
Description=Mount personal Nextcloud WebDAV
After=network-online.target
Wants=network-online.target

[Mount]
What=https://cloud.domain.tld/remote.php/webdav/
Where=/cloud.domain.tld
Options=noauto,user,uid=myself,gid=myself
Type=davfs
TimeoutSec=60

[Install]
WantedBy=remote-fs.target

The command is sudo systemctl start cloud.domain.tld.mount, the error is 401 Unauthorized.

Ideas? Thank you!

As soon as you have activated 2FA, you will need an app password instead of a normal password for such things. You can generate this here:

/index.php/settings/user/security

See also:

https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/authentication.html

1 Like

Thank you! It works!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.