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:
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..