We have a Linux box (Ubuntu, but that shouldn't matter), say, somemachine.example.com, and a user that has access to that machine, someuser.I can SSH into that machine either by explicitly provided a password for someuser like so:ssh someuser@somemachine.example.comPassword: *****...or by providing a PEM file (public key):ssh -i ~/path/to/somemachine.pem someuser@somemachine.example.comToday I had to change the password for someuser on that box (using the passwd command), and was a little surprised to learn that I didn't have to also regenerate new keypairs (thus, new PEM file) for that user as well.I'm wondering: why? Is there simply no connection between someuser's password and the public/private key? If so, does Linux maintain, for each user, a set of credentials, which could either be passwords or public keys? How does Linux associate keys and passwords with particular users?
Why don't I have to regenerate keys when I change a user's password?
users;key authentication;passwd
ssh keys and login-passwords are stored in separate locations on virtually any Unix-like system.  There's no reason why (aside from 30 years of history preceding ssh) the two couldn't have used the same storage.  But what we have now is separate, with scattered attempts to store the collection of credentials in key-managers.Typically a user's ssh information is in $HOME/.ssh, while the logon information is in /etc/passwd, /etc/shadow/, /etc/group and /etc/gshadow.A key manager could combine those, by providing passwords (or the analogous information) as needed.  But that's the exception rather than the rule.Not to recommend it one way or the other, I worked with SnareWorks a while back.  If you google on that, it appeared on the scene around 2000.  That collected the credentials for various applications (or remote systems) and associated the collection with a user.