This question already has an answer here:
I've generated an ssh key pair with ssh-keygen. The id_rsa.pub file looks like this:
ssh-rsa someLettersAndNumbersABC123 username@host
The host part is what bothers me. Currently it comes from the router. But I want to use that key no matter where I am, whatever the hostname some router gives me. Is it save to simply remove everything after my username? Would that even work?
Once I disabled plain password authentication I wouldn't be able to add another key (or connect at all), if the key depends on the hostname of the client.