I just ennabled 2FA. While my Desktop Clients still work, I can’t mount my cloud anymore, on any plateform. I expected app passwords to solve this: however, after following the steps in the documentation, it doesn’t work.
On Windows 11, I want to use the command
net use * https://<my_Nextcloud_URL>/remote.php/dav/files/myusername/ /user:myusername
> *type app-specific password here*
in PowerShell but I get an error saying that “the user is not authentificated”.
In rclone, I do a “rclone config” and type the app specific password, then I mount, it does something, but when I do a “ls /path/to/mountpoint” I get the following error:
<3>ERROR : IO error: couldn't list files: OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden: 401 Unauthorized
For mounting as a remote WebDAV in KDE directly (using KDE Plasma on OpenSUSE Tumbleweed), I don’t have any error but the drive is empty, and in Dolphin directly, Dolphin freezes as soon as I click go (though in this particular case I’m not even sure that 2FA is the problem).
So I’m kind of stuck, everywhere… I tried adding passwords to existing sessions, and creating new ones, to no avail. Any help would be much appreciated. Thanks!
[/details]
Nextcloud version (eg, 20.0.5): 26.0.2
Operating system and version (eg, Ubuntu 20.04): Linux 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64
on the server, see post for the laptops.
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4
PHP version (eg, 7.4): 8.0
The issue you are facing:
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
- enable 2FA
- try to mount with one of the above mentionned methods using app-specific password
EDIT: I more or less managed to get around all of the above problems by now.
- On Windows, I followed the section “Mapping drives with Windows Explorer” of this doc page. It’s all GUI, and when I selected “app token identification” it worked immediately. I basically gives the same result as the PowerShell command methods from my original post, but with the bonus that it auto-mounts at login/boot. And it’s pretty fast as well.
- On Linux, I now use rclone; the problem with what I did before was that modifying the old config didn’t work no matter what, but creating a new remote and using an app token from the beginning works. I don’t really understand why, but the important thing is that it works now. Note: the flags that get me the fastest browsing are:
rclone mount --dir-cache-time=1000h --vfs-cache-mode=full --vfs-cache-max-size=150G --vfs-cache-max-age=12h --vfs-fast-fingerprint remote: local&
- As for Dolphin and KDE Online Accounts, I did not make any progress. It just doesn’t work.
I hope this info will be usefull to someone one day!
Nextcloud and system info:
The output of your Nextcloud log in Admin > Logging:
I don’t see anything relevant to security or passwords in my logs.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'myinstanceID',
'passwordsalt' => 'mypasswordhash',
'secret' => 'mysecret',
'trusted_domains' =>
array (
0 => 'mydomain.com',
1 => 'cloud.mydomain.com',
),
'default_phone_region' => 'FR',
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '26.0.2.1',
'overwrite.cli.url' => 'https://mydomain.com/nextcloud',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud_user',
'dbpassword' => 'hashofdbpassword',
'installed' => true,
'log_type' => 'file',
'logfile' => '/var/log/nextcloud.log',
'logfilemode' => 416,
'loglevel' => 0,
'logdateformat' => 'F d, Y H:i:s',
'maintenance' => false,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'myuser',
'mail_domain' => 'mydomain',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => 'in-v3.mailjet.com',
'mail_smtpport' => '587',
'mail_smtpname' => 'something',
'mail_smtppassword' => 'something',
'twofactor_enforced' => 'true',
'twofactor_enforced_groups' =>
array (
0 => 'admin',
),
'twofactor_enforced_excluded_groups' =>
array (
),
'theme' => '',
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.8,
),
0 =>
array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0.0,
'password' => '',
),
'session_lifetime' => 31536000,
'remember_login_cookie_lifetime' => 31536000,
'app_install_overwrite' =>
array (
0 => 'documentserver_community',
),
'enforce_theme' => '',
);
The output of your Apache/nginx/system log in /var/log/____
:
Nginx: access.log (x2) and error.log (x10-ish), all empty
Apache2: nothing
System: inexistant
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
no such logs.