If I set up an ssh key, upload it to the server, and then disable password login...
When I want to ssh from another machine? How would I then upload that key to the server?
@hellomiakoda So the private key portion you use to authenticate against the public key portion which is uploaded to the server is supposed to be the portable secured portion. Basically that would be secured on a hardware token or encrypted USB. And you'd be able to move that from machine to machine but never copying the private key to a foreign machine.
So what is your use case, I might be able to add more clarity if I understand how you're planning to use it.
EDIT: Just re reading this and I've confused myself now. So even I need to re-read how it works LOL.
@hellomiakoda Okay, so on each machine you want to connect to you add the publickey portion into the authorized_keys file for the user you're connecting as. Then the machine you're connecting from has to have the private key in the ssh profile (usually under the user home directory ~/.ssh
Then when you connect to the machine using your key.
So say on "remote" machine I am user bob and on local machine I'm user bobmcbobberson.
On remote machines bob profile I open the authorized_keys file under the bob/.ssh folder and add my (bobmcbobberson) public key text into it)
Then on my local machine I ssh into the remote machine -> ssh bob@remotemachine
Depending on your key you might need to type a password to open the private section which will authenticate against the remote machine. If it prompts you for a password to connect to the remote machine then password auth is still enabled
@JSCybersec Yeah, I just copied my key in to authorized keys myself, and it worked. Ok, this makes more sense now!
Which means I could easily put my keys in my password manager if I want.