title: Script or tool for adding users to server with ssh keypair login
body: <p>Is there a tool or a common script for adding users to a linux server that also configures the ssh keys?</p>
  <p>For example, I found I can automate creation of users with <code>useradd</code> or <code>adduser</code>, and it is even possible to setup an account with password login with e.g. <code>adduser --password my_password</code>. However, that still leaves me having to add the <code>.ssh</code> folders and files and set the correct permissions, which in my case leaves plenty of room for typos.</p>
  <p>What I am looking for is something like</p>
  <p><code>adduser --ssh user_public_key</code></p>
  <p>where <code>user_public_key</code> is key provided to me by the new user.</p>
  <p>I imagine there might be an existing tool for this, but my duckducking didn't turn up anything useful.</p>