I have an interesting issue with my Ubuntu box that I feel like is probably just a configuration issue on my part but hopefully one of you wizards can help me figure it out.
I have an Ubuntu 18.04.4 install that I use for video game servers for my friends and I. At the moment, I have Minecraft and Terraria running on it. These servers run within their own user (I have a Minecraft user and a Terraria user) to keep things separated. Additionally, I have a privileged user that has access to juuuust about everything with sudo.
I setup key-based authentication on my server as the title implies. I followed a YouTube video on how to set it up, which guided me to create a ".ssh" directory inside my main user's home directory, and use that to store the authorized keys. The .ssh folder has 700 privileges, and the rest of the files inside are 600. Did all that, bippy boppity boom! It works!
So If I open putty and ssh into my server it works fine as long as I choose the privileged user as the user in which I wish to login as. If I try to login as the Minecraft or Terraria user, no dice, the server rejects the key.
I tried creating the same .ssh/authorized_keys folder for the Minecraft user to test my theory that I needed to have the public key also in the Minecraft user's home directory for it to work. Still no dice. (this was my issue that the below answer solved. The key in this file was not a single line) Infact, there isn't really a typical home directory for either of the other users.
The privileged user has a home folder in /home/USER/ but the others do not, and I feel like this may be the root of my issue but I am unsure how to go about creating this directory for my users without breaking the installations of the servers that operate on them.
That's about what I have going on here, and if any of you folks have insight as to why my ssh isn't working for those users I would love to hear it. Thanks in advance!