If we would use:

1) password authentication through ssh 2) key auth - the public key's line are already in the servers authorized_keys

Q: So in either these two ways, storing the public key is unneeded on the client side?

p.s.: I tried to rename the id_rsa.pub file, and I still could log in to a server. so afaik storing the pubkey on client side is not needed. I'm asking this to be 100% sure.

3 Answers 3


You'll want it if you need to add your key to another server (its perfectly normal to have one private key per user per machine, and copy the public key to a lot of machines' authorized keys file).

Its also a very tiny file which doesn't need to be kept secret, so there really isn't any reason to delete it.

If you have deleted it, you can recover it with ssh-keygen -y, so its also fairly safe to delete.


If you are adding client's public key to server's authorized_keys then the client should keep the id_rsa.pub just in case. Beyond that it is not necessary.

Generally that file doesn't take that much space to remove it.


Every guide I've read on SSH says you need it, but you should be able to run without it. You'll need to log in every time without it, though. I can't see why you wouldn't have room for it though, it's tiny.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.