1

When I added my public key into my .ssh/user/authorized_keys file and I saved and restarted my server it gave me this error:

initctl: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
* Restarting OpenBSD Secure Shell server sshd
start-stop-daemon: warning: failed to kill 477: Operation not permitted
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key

I'm not really sure what I did wrong, I have my public key in that folder (double checked) and I also do have it in my own windows 10 computer. Was I suppose to generate the public and private key on the terminal or on my own computer? I also used git bash to to generate it because normal window's terminal would not work. I also think that my home directory is encrypted because when I typed in the command:

df $HOME

part of it displayed /vz/private/ if that helps. My /etc/ssh/sshd_config file is fine too, it has this:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile /etc/ssh/%u/authorized_keys

I have been working on this for a few hours already, if anyone also knows a good tutorial on ubuntu please give a link because I have been struggling trying to make my server as secure as possible for the past week.

UPDATE: I have tried to remove and regenerate the host key using this site https://www.digitalocean.com/company/blog/avoid-duplicate-ssh-host-keys/ but when I do service ssh restart I still get the error above except instead of:

    start-stop-daemon: warning: failed to kill 477: Operation not permitted

I get instead:

    start-stop-daemon: warning: failed to kill 1015: Operation not permitted

Incase if it helps, I still am being prompted for a password and it does display a warning that there was a new key generated when I log onto a new putty secession. EDIT:1 Ok so I found out what as wrong, I was not using sudo when I did service ssh restart, however I am still not prompt for public key authentication when I log in..

  • Ok so I found out what as wrong, I was not using sudo when I did service ssh restart, however I am still not prompt for public key authentication when I log in... – J4102 Apr 23 '16 at 15:36
0

Served does not have the host keys. You need to create them, preferably using

dpkg-reconfigure openssh-server
  • ? I thought you were suppose to create them on the client... this is what I'm using. help.ubuntu.com/community/SSH/OpenSSH/Keys – J4102 Apr 23 '16 at 12:20
  • They are called "host keys" for a reason. – Jakuje Apr 23 '16 at 12:21
  • I did ssh-keygen on my computer which generate the id_rsa and id_rsa.pub and then I pasted the public key into the authorized key file... isn't that right? Sorry if I'm wrong – J4102 Apr 23 '16 at 12:22
  • It is ok for client authentication keys. But you also need the others ^^ – Jakuje Apr 23 '16 at 12:23
  • Well digital ocean and ubuntu wiki didn't do a very good job in explaining it.. or I am just a bad reader – J4102 Apr 23 '16 at 12:23

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.