Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I have a new dedicated server, which I currently access with username and password over ssh. I have not yet set up an ssh key. I am just looking into it now.

So this is a new server with ubuntu freshly installed, is it normal that the /etc/ssh/ directory already has ssh_host_ecdsa_key and ssh_host_rsa_key files on it? I can also files for these as well.

Does this mean whoever set up the server can access it using those key files? I want to be the only person who can log in to my server.

I am not an experienced linux user, still trying to learn.


share|improve this question
FYI: Those keys are only used to identify the server to the user,not the other way around. – andol Jan 5 '14 at 16:12
up vote 0 down vote accepted

Yes, ssh server keys are normally created during installation of the openssh server package. But don't worry, if you don't want to use those, just create your own new ones:

ssh-keygen -b 2048 -f /etc/ssh/ssh_host_rsa_key

then restart sshd.

Of course, if your hosting provider wanted to compromise your server, they could have installed a compromised copy of ssh-keygen. Or maybe /bin/ls...

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.