Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Synology NAS: Trying to login after 2-factor authentication results in "wrong verification code. please try again"

I was not able to login to my Synology NAS (running on DSM 7) after I've enabled 2-factor authentication.

Searched a solution I ended up to this page: https://kb.synology.com/en-uk/DSM/tutorial/How_to_reset_my_Synology_NAS#x_anchor_id9

But they suggest to backup the system and I was not able to backup as I couldn't access. Well, probably I could mount the drive and backup from that but I wanted to find another solution.

like image 229
Camaleo Avatar asked Sep 07 '25 03:09

Camaleo


2 Answers

You need to have SSH enabled and your account need to be an administrator.

  1. login trough SSH using your account
  2. to add a password to the default admin account, issue this command: sudo synouser --setpw admin 1
  3. your admin account should be disabled, so you need to enable it in order to access trough the web interface. To do so: sudo synouser --modify admin admin 0 [email protected]
  4. now open the web interface and you will be able to login as admin, use password 1.
  5. open "control panel" > "users & groups"
  6. select the user that cannot login anymore and click on Edit
  7. disable 2-factor authentication

sign out and you will be able to login again.

Be sure to disable the 'admin' account again for security reasons.

Some useful info came from this document: https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_Administration_CLI_Guide.pdf

like image 61
Camaleo Avatar answered Sep 11 '25 00:09

Camaleo


Search in the settings for "NTP". You will then find a "Regional Options" Pane where you can set the NTP-Server. A simple synchronize now solved my problem.

like image 40
lukas Avatar answered Sep 11 '25 00:09

lukas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!