1

I'm a Windows user trying to wrap my head around Linux, and lately that means following behind people on Raspberry Pi projects.

I've noticed that there are applications that require me to enter the username and password into their config file for them to access things as that user. Samba/CiFS/NTFS-3g and Deluge being examples.

In Windows, things like services (aka daemons) can run under the Local System account (different links), or a variety of other accounts.

It seems strange, and inherently insecure, to put passwords in text files as plain text. Yet, I'm always hearing about how Linux is supposed to be more secure than Windows.

How can you securely pass credentials to random applications in Linux/Raspbian? Are the security models so different that this is mitigated in some other manner? How do I keep track of (or update) what programs I put in a static password?

Am what I am looking for a "keyring"? Something described here.

This question is similar, but asks about the OS and I'm referring to applications.

1
  • There is no security advantage to storing passwords in a binary file (e.g. the Windows registry) over a text file. (There is a moderate advantage if passwords are stored in a TPM and retrieved at runtime via Bitlocker; this is also doable under Linux but takes some effort to set up.) Jan 26, 2016 at 22:30

1 Answer 1

1

Here's the thing. It's based on how the application works or how it was developed. It usually stops there. You can't blame Linux (or in this case, any unix-like OS) for those things. You'll find some applications out there that say the password can be in cleartext OR hashed in say, sha256. This is normally for compatibility reasons, as you may find out later in something else you may learn to setup.

You bring up Samba, and that's a good example of a situation where you think you could have an encrypted password or maybe a "store" where the passwords sit. That is not the case with Samba. What happens with Samba is when a client is communicating with a server or a workstation's share, it HAS to send the password in clear text. The CIFS daemon nor the Samba server can perform encrypted password exchanges. If the connection is encrypted, then you are somewhat "fine" in this regard. Newer versions of the SMB protocol do allow encrypted connections.

However, keep in mind too, files that have credentials (like config files) should be heavily dropped in permissions (say 600). A samba mount that always needs to be there on boot and put in /etc/fstab can be pointed to a "credential" file. It's cleartext, but can sit in /root, which means no user can see it. Only an administrator can, because /root is 700.

But again... this is based on the application you've installed or you're setting up. Look at OpenLDAP for example. When you configure the directory manager's password, you have to use slappasswd. It generates a {SSHA} string that you use in the configuration. And the configuration files cannot be viewed by a non-privileged user. /etc/openldap/slapd.d is 750, the files are 600 down the tree.

Keyrings are very specific to the desktop environment you're in. GNOME has GNOME Keyring, KDE has KWallet, for example.

The "security" comes down to many other factors: File System Permissions, SELinux (if applicable), Firewall capabilities, chroot jailing (specific applications, bind is an example), application security, tcp wrappers, and much much more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .