On unix systems, each separate user account has a unique username. Passwords, then, are not unique - every distinct user could have the same exact password.
I want to do the converse. I want one username, but I want that login name to have multiple passwords. Depending on the password, you would either be logged into a different account (with a different UID) or you would simply have a different home directory.
The goal is for two separate entities to share the same username but have their files be separate - in this case, file permissions between different UIDs are less important.
Any thoughts on how to accomplish this, or something like it? Some abuse of /etc/shadow or PAM?
Is this something that could be accomplished by writing a PAM module (I've never written one before. Is it very very hard?)