Show HN: Securely set the same password on thousands of Linux servers
github.com
github.com
The main point is always having password access for cruicial services, so any given ops engineer can login from almost everywhere. In real life there can be different situations, anecdotal, but at some point of time I have to fix problem via SSH shell from my mobile phone.
Also, shadowd do not make assumption about same password distribution, it can handle any amount of passwords by your choice, depending on severity and importance of service.
But anyway, just disable passwords and login with SSH public key authentication.
SSH keys are good, but there are always should be rescue password which can be entered via IPMI or by physically attaching to the server. Also, `sudo` password (which is also handled by /etc/shadow) is a good measure on production servers and should be set somehow. shadowd resolves it.
If it's an emergency you can reboot into a single user/recovery/rescue state and reset it. No need to increase the attack surface just for that.
>Also, `sudo` password (which is also handled by /etc/shadow) is a good measure on production servers and should be set somehow.
I agree about a sudo password being a good idea, but if we're talking about the "right" way I'd say a authentication directory backend of some sort would be better suited for that.
Regarding authentication backend I've already tried to address that vision. Unable to become root when auth backend offline/unreachable/misconfigured is significantly worse than having local shadow which is always works.
Agreed, if you have something like dish installed, something like
dish "echo root:password | chpasswd"
should do the trick to everything dish knows about.
This is a simplification, but the general idea isn't too far off. If you don't know why its a simplification, then doing it this exact way is probably a bad idea.
shadowd/shadowc is exactly the tool that generates X different salted hashes and distributes it to remote sites, as you described. It embeds to any infrastructure almost painlessly.
I understand LDAP can be quite obtuse to configure (particularly after OpenLDAP dropped config files), but once you get it working it is rock solid.
LDAP is definitely proven (esp in a LAN/non-cloud environment), but isn't perfect: if LDAP is DoS'ed (even from the very servers that it's authenticating for), then you can't log into any servers (or if a maintenance window exceeds the cache window, or even if it's just taken offline via hostname change or something). It also doesn't help much with user-based UX (i.e., key rotation, granting someone additional rights usually has to go through a centralized IT dept, etc) and caching is pretty awful, and it's a pain to securely configure. Lots of risk of inadvertently opening a hole through an insecure PAM/NSS configuration or ACL's.
The worst part with LDAP is the long and sordid history of LDAP and KRB5 root-level vulnerabilities.
Even with all of these drawbacks, LDAP probably less risky than storing (even different) hashes of the same password across thousands of boxen!
Disclaimer: I'm the CTO @ https://Userify.com ; we build an SSH Key management tool that's specifically designed for cloud servers.
Also its "easy" to set up insecure ldap or more precisely its easy to not deny insecure ldap connections, but its hard to mess up something like Kerberos to be overly permissive... But it doesn't matter, it just changes the scenario to "kerberos is dead for whatever reason, need root login to fix".
But, I hope, I describe point about LDAP and stuff in replies to other discussion members comments.
All other nodes will have different salt+hash pairs, so brute-forced password will be not valid for them.
If your attacker is able to "figure out" 128-bit+ passwords, then you've probably got other problems. And if the point of using passwords is for emergency logins from phones, I'm not sure how useful a 80 char pass is. Might as well keep the ssh key saved somewhere and type it in eh?
Because of this I now use pam_ssh_agent_auth and try to never enter my actual password into any remote server. Of course this still means there is a risk: I have to forward my ssh agent to the remote server, and an attacker with root access there may in fact hijack that connection and connect to other servers using my credentials. However, (1) this can only happen so long as I am connected to the server, (2) I can be notified every time my private key is used to respond to a challenge, and (3) the attacker never learns any of my personal secret values (password or private ssh key).
Don't go and reinvent the wheel if there are far better technologies widely adopted!
I'm not arguing this was a nice thing to say, I'm arguing it shouldn't disappear. We have the power to downvote people when they say things that don't fit in the community but pass a very basic civility guideline. Comments that aren't substantive should disappear. Comments potentially with some meat but offensively presented should just be downvoted, in my opinion.
I don't generally want to be the HN rules police, but this particular rule is a very good one, which took the site some time to be adopted, and I think it's worth speaking up for.
Note that I didn't call for it to be censored or even modded down, I said I stopped reading it because I felt it was a childish response to a serious issue. It seems you somehow inferred that I felt it should "disappear", but I don't feel that way. I simply choose not to read the rest of it, which hurts no one's feelings.
Perhaps a more productive comment would ask "what advantages this has over LDAP"
LDAP, or LDAP + Radius (for integration with a second factor) is still a dynamite technology and pretty much required once a network / team reaches a certain size. There's definitely demand for an "EasyLDAP" or the like that offers sane defaults and easy config for deployment in a cloud environment.
Also, having config in the db means you can make online configuration changes that take effect instantly and are replicated to all other replicas.
I can't imagine a single reason why I will do remote login service for the root user on the front-end load balancing server of a high load project.
shadowd is not remote login provider, it only serves /etc/shadow hashes for local and possibly offline use.
with SSSD there is no excuse for not using AD/LDAP.
Having done both, shipping /etc/passwd and using AD, its far more effective, secure, and crucially stable to have LDAP/AD as the single source of truth.
Its not like its difficult anymore, you can even buy in AD from AWS. (just don't try and do machine accounts, you're better off using puppet/ansible for that sort of thing.)
Think about it, you wouldn't ship /etc/hosts anymore would you? why do the same with user accounts.
The right way to do for me is simplicity and using tools, that offers solution for small problems; using overcomplicated bloatware doesn't seems to be right way to do, especially now, when we have that rapid growth in software development.
I would ship /etc/hosts if there will be major performance impact of doing millions of DNS queries across network under high load. It depends on the concrete case.
AD/LDAP allows SSO for everything ssh, bash, gmail, AWS console, etc. Because its a centralised, when someone leaves, or their account is compromised then its one place to change it. Crucially its one source of truth across the entire estate, not just for "servers" or "desktops"
As for "massive configuration, maintenance and ugly design." Its really not. Also purity of design is not getting the job done. Your approach is ok if you only have a few servers and a handful of users.
The point of ansible/puppet/salt/$other playbooks is that 90% of the work is done for you. All you have to do is input your users, and roll out the SSSD conf (after testing) Even by hand openLDAP isn't that hard.
As for the rhetorical question about /etc/hosts you wouldn't because thats what nslcd/sssd/Program caches are for.