# Where and how are credentials stored for mounted network drives?

**URL:** https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085
**Category:** General Discussion
**Created:** [31 March 2026 15:19 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085 "2026-03-31T15:19:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rmscode](https://dietpi.com/forum/user_avatar/dietpi.com/rmscode/32/5164_2.png) [@rmscode](https://dietpi.com/forum/u/rmscode)
#### Post date: [31 March 2026 15:19 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/1 "2026-03-31T15:19:53Z")

</div>

I’m sure that they are securely kept. I just want to know where and how 🙂

---

<div class="post-metadata">

### Author: ![rmscode](https://dietpi.com/forum/user_avatar/dietpi.com/rmscode/32/5164_2.png) [@rmscode](https://dietpi.com/forum/u/rmscode)
#### Post date: [31 March 2026 15:44 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/2 "2026-03-31T15:44:09Z")

</div>

I found it. I answer my own questions too often 😅.

`/var/lib/dietpi/dietpi-drive_manager`

Stored in plain text 😕, but “protected” with file level permissions (`chmod 0600`, `chown root:root`).

---

<div class="post-metadata">

### Author: ![rmscode](https://dietpi.com/forum/user_avatar/dietpi.com/rmscode/32/5164_2.png) [@rmscode](https://dietpi.com/forum/u/rmscode)
#### Post date: [31 March 2026 17:15 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/3 "2026-03-31T17:15:42Z")

</div>

For the record…I did not mark my own answer as the solution 😂.

Thanks @Joulinar lol

I wouldn’t know the first thing about it, but how could this be made more secure, so the creds aren’t stored in plain text?

Store them in the keyring some how?

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [31 March 2026 18:19 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/4 "2026-03-31T18:19:19Z")

</div>

On a headless system keyrings are not preinstalled and it’s also not a pretty “diet” way to do so.  
IMO the actual implementation is safe enough. If somebody get’s root access everything is lost anyways 🙂

But to answer your question in a more technical way: Hashing is not an option, bc the drive manager needs it in plain text.  
So an option would be some sort of encryption, but then you need to know a key and you need to store the key somehwere, so you got a new problem.

But it’s really quite common to store it as plain text and restrict the access to root (or some other user), for example fstab does this for smb credentials, or you store it in a file`.smbcredentials` also in plain text.  
`wpa_supplicant.conf` does it too, and `.netrc` and many more 🙂

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [31 March 2026 19:20 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/5 "2026-03-31T19:20:21Z")

</div>

I ask Gemini AI for an answer 🙂

**Summary:** For 99% of use cases, a **chmod 600** file is the industry standard for securing SMB shares on Debian.

### advanced more complex alternatives

If you require hardware-level encryption or higher security:

- **LUKS:** If your root partition is encrypted via LUKS, the credentials file is physically secure when the system is off.
- **Systemd-creds:** Modern versions of Systemd (available in newer Debian releases) allow for encrypted credentials managed by the system manager.
- **Kernel Keyring:** You can use the `keyutils` package to store secrets in the kernel’s RAM-based keyring, though this is significantly more complex to automate at boot.

So Gemini agrees with @Jappe on the methodology here. As mentioned earlier, in order to read the file, the attacker must gain root privileges or at least obtain root access. Hopefully, this wouldn’t happen in a home lab. However, if the system is located within the internet, the scenario would certainly be different.

BTW

> [@Jappe](#):
>
> bc the drive manager needs it in plain text.

It’s not our drive manager who needs this. 😉

---

<div class="post-metadata">

### Author: ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)
#### Post date: [29 June 2026 19:20 UTC](https://dietpi.com/forum/t/where-and-how-are-credentials-stored-for-mounted-network-drives/25085/6 "2026-06-29T19:20:51Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
