Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFA & nextcloudcmd #1779

Open
ptman opened this issue Feb 12, 2020 · 6 comments
Open

TFA & nextcloudcmd #1779

ptman opened this issue Feb 12, 2020 · 6 comments
Labels
enhancement enhancement of a already implemented feature/code feature: 🔑 authentication feature: 🔳 nextcloudcmd feature-request new feature

Comments

@ptman
Copy link

ptman commented Feb 12, 2020

Expected behaviour

nextcloudcmd should work with TFA

Actual behaviour

nextcloudcmd doesn't work with TFA

Steps to reproduce

  1. Enable TFA
  2. run nextcloudcmd
  3. get error

Client configuration

Client version: Nextcloud version 2.6.2-1

Operating system: Debian bullseye

OS language: English

Qt version used by client package (Linux only, see also Settings dialog): 5.12.5

Client package (From Nextcloud or distro) (Linux only): nextcloud-desktop-cmd/testing,now 2.6.2-1

Installation path of client: /usr/bin/nextcloudcmd

Server configuration

Nextcloud version: 17.0.1

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.

02-12 16:45:08:356 [ warning nextcloud.sync.networkjob ]:	QNetworkReply::AuthenticationRequiredError "Error transferring https://.../remote.php/webdav/ - server replied: " QVariant(int, 401)
02-12 16:45:08:356 [ info nextcloud.sync.networkjob.lscol ]:	LSCOL of QUrl("https://.../remote.php/webdav/") FINISHED WITH STATUS "AuthenticationRequiredError Error transferring https://.../remote.php/webdav/ - server replied: "
02-12 16:45:08:356 [ warning nextcloud.sync.discovery ]:	LSCOL job error "Error transferring https://.../remote.php/webdav/ - server replied: " 401 QNetworkReply::AuthenticationRequiredError
@rullzer
Copy link
Member

rullzer commented Feb 12, 2020

What is TFA?

@rullzer
Copy link
Member

rullzer commented Feb 12, 2020

Ah two factor authentication.
Well be sure to use an apptoken then. Because your native password will indeed not work.

@ptman
Copy link
Author

ptman commented Feb 13, 2020

Excellent. How does one use an apptoken with nextcloudcmd?

@ptman
Copy link
Author

ptman commented Feb 19, 2020

Is nextcloudcmd supposed to be usable with apptokens?

@edent
Copy link
Contributor

edent commented Apr 25, 2020

@ptman I use an app token with nextcloudcmd.

For example

nextcloudcmd -u "admin" -p "ABCD-1234-5678-EFGH" ~/nextcloud/ https://example.com/nextcloud

@kohane27
Copy link

kohane27 commented Feb 4, 2023

@edent Thank you so much for your reply. I was struggling with it for days and finally figured it out. To elaborate on it:

You can't use your login name and password in nextcloudcmd. To use an app token with nextcloudcmd, go to https://efss.qloud.my/index.php/settings/user/security . Under Devices & sessions, you should see an input field App name. Type your app name to generate email and password. Then use them in your nextcloudcmd to perform a sync:

nextcloudcmd --user 'name@mail.com' --password 'app-token-password' /home/name/Nextcloud/ https://efss.qloud.my/ > /dev/null 2>&1

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhancement of a already implemented feature/code feature: 🔑 authentication feature: 🔳 nextcloudcmd feature-request new feature
Projects
None yet
Development

No branches or pull requests

6 participants