Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 7 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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