This is for Ubuntu 16.04, if that matters. I tried making a tag but it said I don't have enough rep.
I set up an SFTP server on an Amazon AWS EC2 instance so our clients can transfer files securely. I'm decent at programming and I have a basic grasp over network concepts, however my problem is that I've never worked with Linux before and have no working knowledge of it. I was able to get the server set up and remote into it using both PuTTy and the GUI application WinSCP.
That's great for me, but now I need to set up users for our clients to remote into the server and drop their files.
It seemed to work fine when I used
useradd myuser passwd myuser
to create my new user. However, I want to generate and add a separate key for each user for them to authenticate with and I'm getting lost and really confused in a sea of browser tabs which include the phrases ~/.ssh/ and authorized_keys.
I know I can use PuTTy to generate a priv/pub key pair and to save the public key into the authorized_keys file. But how do I do that? Also, is there a better way to go about this?
Bonus Question: What's the best practice for sending/receiving a key from/to a client?
I managed to get a user set up and guess I got my own key added to authorized_keys correctly because they were able to get on and drop a test file for me. I ended up sending my own private key to them in an email with the thought that if they messed anything up I would just kill the instance and fire up a new one. I know without having to be told that was a big no-no, but I needed immediate results. Honestly, at around my third day of researching, I briefly entertained the idea of simply doing that for all our clients, but I was worried that would be the genesis of a disturbance which one day causes all celestial bodies in our solar system to perfectly align and allow cosmic energy to flow directly into our sun, ultimately destroying Earth, so instead I am making this post