You get your files back from SSSD by restoring the files the service is meant to store — home directories, cached credentials, and local user records — and by fixing the configuration or permissions that made them unreachable. The key condition is scope: SSSD itself keeps almost no user documents, so "SSSD files" usually means home directories behind an SSSD-provided identity, cached home directories on a laptop, or /var/lib/sss/ databases. Identify which one you've lost before restoring anything.
If your documents vanished after a login change, the likely culprit isn't SSSD wiping them but a new UID/GID or a different home path. Check that first. It's reversible, cheap, and catches most cases.
First, Separate the Three Things People Mean by "SSSD Files"
SSSD (System Security Services Daemon) is the identity and authentication broker on Linux. It talks to LDAP, Kerberos, Active Directory or a local domain, and it answers "who is this user, what groups do they belong to, and can they log in?" It does not manage documents the way a file server does.
So "my files" breaks into three distinct stores, and each has its own recovery path:
| What you mean | Where it lives | Typical cause of loss | Recovery owner |
|---|---|---|---|
| Personal documents in /home/username | Local disk, NFS, or automounted share | Wrong UID after domain join, changed home directory, mount not present | You (or the file server admin) |
| Cached home directory for offline logins | Local disk under the configured home path | Cache expired or purged, joined then unjoined the domain | You |
| SSSD's own state (users, groups, sudo rules, secrets) | /var/lib/sss/db/, /var/lib/sss/mc/ | Corrupt cache, wrong domain, deleted database | You (rebuild) |
Most panicked searches about "getting files back from SSSD" are case one: the user can log in, but /home/username is empty or shows Access denied. That's almost never data destruction. It's an identity mismatch.
Identify Your SSSD Layout Before Restoring Anything
Don't restore blindly. Five or six commands tell you where your files actually are and what SSSD thinks about your account.
1: Run id in a terminal. Note your numeric UID and GID, and every group you're in. 2: Run getent passwd username. Compare the home directory and UID here with what you expected. A changed UID or home path is the single most common root cause. 3: Run sssctl user-checks username. This asks SSSD directly what it knows about the account, which domain answered, and whether it came from cache or a live provider. 4: Run findmnt -T /home/username to confirm which device or server backs your home directory. If it's an NFS share, the answer changes entirely. 5: List SSSD's persistent state with sudo ls -la /var/lib/sss/db/ and sudo ls -la /var/lib/sss/mc/. 6: Check the profile config with sudo grep -E 'domains|services|enumerate|use_fully_qualified_names' /etc/sssd/sssd.conf.
Expect the output to name your domain and show your actual home path. If step 2 and step 4 disagree — say SSSD reports /home/jdoe but nothing is mounted there — you've found the problem with your files without touching a single backup.
Recover Documents When the Home Directory Points Somewhere New
This is the scenario where files "disappear" but nothing was deleted. A domain join or a UID standardisation rewrote your passwd entry, and the system now expects a home directory that was never populated.
1: Note the home path SSSD reports, for example /home/jdoe. 2: Search for the old data by UID rather than by name, because names follow entries and entries follow UIDs: sudo find /home /srv /var/backups -xdev -uid 1001 -type f 2>/dev/null | head -50. Substitute the old UID you remember or that a colleague's id output suggests. 3: If you find the old folder, copy it into the new path with ownership intact: sudo rsync -aHAX --info=progress2 /home/oldname/ /home/jdoe/ then confirm with ls -ln /home/jdoe that files are owned by the numeric UID SSSD now reports. 4: If your old home was on a share, mount it first and repeat: sudo mount /mnt/oldhome (or your automount path), then copy across.
You'll know it worked when logname and stat -c '%u %n' ~ agree with the UID from getent passwd, and your desktop session shows the files. If they still don't, check whether the directory is protected by an ACL with getfacl ~ — a stale ACL blocking the new UID looks exactly like lost files.
Restore Files From a Cached Offline Home Directory
SSSD can answer logins when the domain is unreachable, but it doesn't store your documents. If you're thinking of a cached home directory, that's usually a local folder that was populated when you last logged in online. Two things go wrong: it was on a separate partition that isn't mounted, or a domain re-join cleared it.
The recovery order matters:
1: Mount everything before logging in: sudo mount -a, then confirm findmnt -T /home. 2: Log in and check whether ls -la ~ shows the files. 3: If the folder is present but the directory listing is empty, look for a hidden snapshot directory your distribution or backup tool created, such as .snapshot, .zfs/snapshot, or a ~/.cache exclusion note. 4: If a re-join really did wipe the local folder, restore from the backup system your organisation runs against /home — the volume name is usually home or the short hostname pattern in your backup tool's documentation. 5: As a last resort, check whether files were moved into a renamed folder by the joiner script: sudo find / -maxdepth 4 -type d -uid $(id -u) -name 'old' 2>/dev/null.
That last search catches the common case where an automated domain join renames the old home to username.old rather than deleting it.
Rebuild SSSD State Without Losing Users or Rules
If login itself fails with "user not found" or "domain not found", your problem is in the SSSD database, not your documents. The fix is to rebuild the cache, and it's safe: SSSD regenerates everything from the provider on next start.
1: Stop the service: sudo systemctl stop sssd. 2: Remove cached databases: sudo rm -f /var/lib/sss/db/.ldb /var/lib/sss/db/.ldb.d/* and sudo rm -rf /var/lib/sss/mc. Do not touch sssd.conf. 3: Clear the kernel keyring cache: sudo sss_cache -E. 4: Start the service: sudo systemctl start sssd. 5: Verify with sssctl domain-status yourdomain and sssctl user-checks yourusername.
Success looks like a live-connection status and a resolved user from the specified domain. If it still fails, read the tail of the log — sudo tail -100 /var/log/sssd/sssd_yourdomain.log — and look for TLS errors, a wrong ldap_uri, or a Kerberos clock skew above five minutes. The log names the actual cause; guessing wastes time.
Repair Permissions That Make Files Look Missing
A file with an unreadable parent directory behaves like a missing file. This bites after domain migrations where SSSD returns a new UID but the old folder still belongs to the numeric UID of a deleted account.
Check with namei -l ~ to see the permissions chain on each path component, and find /home/username -maxdepth 1 ! -user $(id -u) -ls to catch files owned by someone else. Then fix ownership recursively — only on your own tree, and only after confirming no shared files live inside it:
sudo chown -R $(id -u):$(id -g) /home/username
If your home sits on NFS and SSSD maps IDs via idmapd, a wrong Domain line in /etc/idmapd.conf can cause the same symptom across the whole export. Fix it on the client, restart nfs-idmapd, and retest with stat on a known file. Reversibility is the rule here: keep a ls -laR listing saved to /tmp before any recursive change so you can restore ownership if something looks off.
When the Data Genuinely Isn't on the Machine
Before long troubleshooting sessions, rule out the obvious: the files may never have synced, or they may live on the server rather than locally. Two checks settle this quickly.
Log into the file server directly with your credentials and browse your share. If the files are there, the recovery is a mount or an autocorrect of an automount path, and your local efforts were pointed at the wrong target all along. If they're not on the server either, only the backup tier can help.
Check the backup system's retention window — most organisational backup schedules keep weekly snapshots for four to eight weeks and monthly snapshots for longer, and restore requests inside the window are routine. The name and version of the backup tool vary by site, so confirm the retention policy in your organisation's own documentation rather than assuming a number.
Stop Condition: When to Hand It to a Professional
Three situations justify stopping: no snapshot exists and the underlying disk shows I/O errors or SMART failures; the data sits on a failing storage array where any further write risks it; or the files are business-critical and covered by a recovery contract. In those cases, power off the affected host cleanly, and contact the storage or backup administrator rather than initiating a rebuild or fsck. Continuing on a failing device reduces the odds of professional recovery.
FAQ
Does SSSD store my files at all?
No. SSSD stores identity data — users, groups, sudo rules, and secrets requested through the responder socket — not documents. It can help authenticate you and locate your home directory, but the files themselves live in the home path, on a mount, or on a remote share. Confusing the two is why "my files are gone from SSSD" feels unanswerable at first.
Where is the SSSD database?
Persistent state is under /var/lib/sss/db/ (.ldb files, with per-domain subdirectories) and memory-cache data under /var/lib/sss/mc/. Secrets for the secrets responder sit in /var/lib/sss/secrets/. All of it is cache-and-config, not documents, and it's safe to rebuild.
Can I recover files deleted by a domain join?
If the join script moved your home to username.old, yes — search for the renamed folder by UID. If it genuinely deleted it, recovery comes from your filesystem's snapshot feature or the backup system. That's why you take a quick listing of /home before any migration, not after.
Why does SSSD show a different UID than my files?
Domain migrations often reassign numeric IDs. SSSD follows the directory's mapping, while the files keep their old owner. Either re-own the files to the new UID or ask your directory admin to pin your UID to the original value — the latter is preferable across a large estate because it fixes every machine at once.
Is it safe to clear the SSSD cache to get access back?
Clearing the cache is safe and reversible; it doesn't touch your documents. It only forces SSSD to re-fetch identity data, so you'll need the domain reachable to log in afterwards. Keep a copy of /etc/sssd/sssd.conf first.
This article is general technical information, not a guarantee of recovery, and not a substitute for your organisation's data-recovery or security policy. Restore operations can overwrite existing data, so confirm the backup target before writing anything. If your files are business-critical or sit on failing hardware, involve a qualified storage administrator or data-recovery professional; if a security incident is suspected, follow your incident-response process rather than troubleshooting alone.