<div dir="ltr">Hi --<div><br></div><div>I've got a situation where I have a very large number of "users", one where I can't be sure all my user accounts would fit on a single machine. </div><div><br></div><div>Additionally - all the users are going to do is set up reverse tunnels.  They can only auth via the authorized_keys as well.  And they don't </div><div><br></div><div>I've looked around and a PAM module may be the ticket - hence my joining the list.</div><div><br></div><div>Does anyone have a suggestion / direction for how to go about doing this?</div><div><br></div><div>I have found a few PAM modules which let you create users on the fly - but I don't have a good way to clean them up after the fact.</div><div><br></div><div>My current "best guess":</div><div><div> * PAM module accepts any username and looks it up  in a webservice for keys.</div><div>  * Changes the user to a uuid, creates the .authorized-keys file and drops the keys in there.</div><div>  * Somehow - knows when the ssh auth is completed, and removes the directory.</div><div><br></div></div><div>My current "ideal":</div><div>  * PAM module accepts any username and looks it up  in a webservice for keys.</div><div>  * Puts those keys into a PAM env-var</div><div>  * Changes the user to a standard , can't do anything but reverse tunnel user</div><div>  * somehow.. those authorized-keys :(   gets put into the ssh workflow </div><div><br></div><div>Hoping someone had a suggestion.  </div><div><br></div><div>Or maybe all of this is just a big mis-use of PAM / SSH and I should just write a server in go or something that checks the keys, opens ports, etc..</div><div><br></div><div>Thanks for any thoughts!<br>Cary FitzHugh</div><div><br></div><div><br></div></div>