How to Fix Time Machine Backup Server Authentication Error
Another how-to on Time Machine backup, available on all OS X and macOS machines. Friendly reminder: your Mac does include nifty backup tools for free of charge, and you can use any drives lying around. If you have an old drive, preferably more than 3 years, and if it is at least the size of your Mac’s system drive, that is a perfect candidate to stow away Time Machine backups in it. Do encrypt your drive though.
Previously I have posted on how to setup a Time Machine Server without a server app, and it should still work. Bear in mind, I would also recommend not allowing access to the said Time Machine drive from a guest, on top of having both .sparsebundle and the drive itself encrypted. After you have done all that, there is a chance your Mac on the client side (e.g. a machine that is trying to create a backup) will not be able to complete the backup due to “network username or password” error.
The common solution to this is to simply wipe keychains related to the network Time Machine from Keychain Access. Simply search for ‘time machine’ and the name of your server, and erase the related items from Keychain Access app. Do be careful when you are deleting them, as this will never limit its search results to Time Machine only.
However, upon inspecting Time Machine logs, I’ve found another potential issue with Time Machine. If you still cannot complete a backup much like I did, you can try the same command on Terminal to see the logs from Time Machine:
printf '\e[3J' && log show --predicate 'subsystem == "com.apple.TimeMachine"' --info --last 6h | grep -F 'eMac' | grep -Fv 'etat' | awk -F']' '{print substr($0,1,19), $NF}'
The log will say authentication error; as it was shown on the GUI. The other story it tells, in my case, was that GUI had setup the destination for Time Machine backups all wrong: .local domain was wrong, username was wrong, even the password was wrong. Let’s fix the issue by presenting the right destination first. On Terminal, simply type out the following commands. You will need to replace protocol (possibly SMB), username, password, servername, and drivename with your own configurations:
sudo tmutil setdestination smb://username:password@servername.local/drivename
If this is your first time using tmutil, chances are it will ask for ‘Full Disk Access’ permission. It is necessary to create a backup of your full disk, and you are providing permission to Terminal. Follow the error output, run the command again, then the Time Machine GUI will show the drive you had already selected via point and click. If you are also encrypting .sparsebundle, you should try adding the same drive from the list with the box ticked for encryptions. This will enable encryptions on your .sparsebundle. Reboot your mac and run the following command to confirm your settings have been saved:
tmutil destinationinfo
Networking issues on macOS seems to have a common tune nowadays. WebDAV server on macOS, wfsctl, also had a similar issues with parsing username, password, and server name from the input. It similary created a garbled configurations which was then fed to other systems, poisoning the overall sever duty done by a Mac.
No user specified. (error -50)
The backup destination could not be set.
THIS DID NOT WORK!
That error code appears when there is no user is provided in the command. You need to replace protocol, username, password, servername, and drivename from the command, tmutil setdestionation.
I DID put the username and password and it STILL did not work.
The time machine utility commands only work if all the parameters are correct. The terminal commands are meant to overwrite automated GUI configuration, if the configuration is set faulty. If all the parameters are correctly inputted, what you are experiencing is a network problem, not a tmutil problem. To troubleshoot, I suggest trying to connect to the server from terminal or finder.
Works perfectly with the command line! Thank you!
Just in case someone else wonders about the password in the URL: specify `setdestination -p` to enter it interactively instead of exposing it.
This did not work (I specified the user, and used the -p option to enter the password). I got error code 13.
I’m not certain what could be the cause behind the error 13, as I haven’t experienced the error in question first hand. But Apple Support Community seems to suggest it might be a network related issue, tmutil not being able to read/write the time machine drive correctly. I’d suggest starting from there.