sodcalculator

10 Tech How-To

Fix Dropbox Auth Error on Ubuntu

Guide 10-12408 · Updated · Step by step

If Dropbox on Ubuntu fails to authenticate—showing errors like “Authentication failed” or endlessly asking you to sign in—the fix is usually to re-link your account by restarting the Dropbox daemon and clearing its cached credentials. Below are the exact steps, what causes the issue, and how to prevent it from recurring.

Why Dropbox Authentication Fails on Ubuntu

Dropbox uses OAuth 2.0 for authentication. On Ubuntu, the desktop client stores a token in ~/.dropbox/. This token can become invalid or corrupted for several reasons:

  • You changed your Dropbox password or enabled two-factor authentication.
  • The system clock is wrong (OAuth tokens are time-sensitive).
  • A previous Dropbox process was killed abruptly (e.g., system crash).
  • You have multiple Dropbox instances running, causing a conflict.
  • File permissions on ~/.dropbox were altered (e.g., by running Dropbox with sudo).

Step-by-Step Fix: Re-link Your Account

This process resets the local authentication state without deleting your files.

  1. Quit Dropbox completely: right-click the tray icon → Quit, or run dropbox stop in the terminal.
  2. Open a terminal and run dropbox status to confirm it’s stopped (should say “not running”).
  3. Remove the cached authentication files (this does not delete your Dropbox folder):
    rm -rf ~/.dropbox/authentication_token ~/.dropbox/authentication_token_
  4. Restart Dropbox: dropbox start. A browser window will open asking you to log in and authorize this computer.
  5. After authorizing, check dropbox status—it should show “Up to date” or a syncing progress.

If the browser doesn’t open, run dropbox start -i to force the installation flow.

If the Fix Doesn’t Work: Check System Clock and Permissions

OAuth tokens have a short expiry and rely on your system time being correct. If your clock is off by more than a few minutes, authentication will fail.

  • Check your time: date. If wrong, enable automatic time sync in Settings → Date & Time, or run sudo timedatectl set-ntp true.
  • Check permissions on ~/.dropbox: it should be owned by your user. If you ever ran Dropbox with sudo, files may be root-owned. Fix with:
    sudo chown -R $USER:$USER ~/.dropbox
  • If you use a proxy or VPN, temporarily disable it—Dropbox may be blocking the auth callback.

Using the Command-Line Client vs. GUI

Ubuntu users often install Dropbox via the official .deb package, which includes a system tray icon. However, many prefer the headless dropbox.py script for servers. The authentication process differs slightly:

  • GUI client: The browser opens automatically and you click “Allow”.
  • Headless (dropbox.py): Run dropbox.py start, then visit the URL it prints, log in, and copy the authorization code back into the terminal.

If you’re using the headless script and the URL doesn’t appear, ensure you have python3-gpg installed (needed for some versions).

Common Mistakes That Cause Authentication Loops

  • Killing Dropbox with kill -9—this can corrupt the token file. Always use dropbox stop.
  • Running Dropbox as root—even once, this changes ownership of config files. Never use sudo dropbox.
  • Editing ~/.dropbox manually—some guides suggest deleting the entire folder; that’s overkill and can cause a full re-download if your Dropbox folder is linked there.
  • Using an old version of Dropbox—Ubuntu’s repositories may have an outdated version. Always download from dropbox.com/install?os=lnx.

Alternative: Use a Third-Party Client

If the official client continues to fail, consider a third-party client like Rclone (for CLI sync) or Insync (paid GUI). These use the Dropbox API with their own authentication and often work when the official client has issues. However, they may lack some features like LAN sync or selective sync. For most users, fixing the official client is simpler.

Preventing Future Authentication Issues

  • Always quit Dropbox properly before shutting down.
  • Keep your system clock synchronized (enable NTP).
  • Update Dropbox regularly—the client auto-updates, but if you installed from a .deb, check for updates manually.
  • If you use two-factor authentication, have your backup codes handy—you’ll need them when re-linking.

Frequently Asked Questions

Will I lose my files if I delete the authentication token?

No. The token only stores your login session. Your files in ~/Dropbox remain untouched. After re-linking, Dropbox will re-sync any changes, but your data is safe.

Why does Dropbox keep asking me to log in after every reboot?

This usually indicates that the Dropbox daemon isn’t starting correctly. Check if it’s set to autostart: systemctl --user status dropbox (if using the systemd service). If not, add dropbox start to your startup applications.

Can I use Dropbox on Ubuntu without the desktop client?

Yes, you can access files via the web interface, or use rclone to mount your Dropbox as a filesystem. This avoids authentication issues entirely, but you lose real-time sync.

What if the browser doesn’t open during authentication?

Copy the URL that Dropbox prints in the terminal and paste it into any browser. If no URL appears, run dropbox start -i to force the installer to re-run.

Is it safe to delete the entire ~/.dropbox folder?

It’s safe in terms of your files, but it will reset all settings and may cause Dropbox to re-download your entire folder if you re-link. Only do this as a last resort.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →