Issue
I am on the process of cloning the ghost open blog cms, theres an option to run a vps through digital ocean. Choosing this method the droplet is created. Next step is to login as root@XXXXX
While doing so I got the dreaded Permission denied (public key). I re-created the ssh keys and updated in digital ocean but that didn't solve the issue.
While running ssh -v root@xxxx
command the output was as follows:
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to xxx [xxx] port 22.
debug1: Connection established.
debug1: identity file /Users/dad/.ssh/id_rsa type 0
debug1: identity file /Users/dad/.ssh/id_rsa-cert type -1
debug1: identity file /Users/dad/.ssh/id_dsa type -1
debug1: identity file /Users/dad/.ssh/id_dsa-cert type -1
debug1: identity file /Users/dad/.ssh/id_ecdsa type -1
debug1: identity file /Users/dad/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/dad/.ssh/id_ed25519 type -1
debug1: identity file /Users/dad/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/dad/.ssh/id_xmss type -1
debug1: identity file /Users/dad/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to xxx as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ecNEC3rocsntZyTMyGGH7MHfMoMufrPOmG8hPRgkwzs
debug1: Host 'xxx' is known and matches the ECDSA host key.
debug1: Found key in /Users/dad/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/dad/.ssh/id_rsa RSA SHA256:/2EjDyRz3HYYyLqEegdjzEy2PfgIGnMNXvwbPzMgRqg
debug1: Will attempt key: /Users/dad/.ssh/id_dsa
debug1: Will attempt key: /Users/dad/.ssh/id_ecdsa
debug1: Will attempt key: /Users/dad/.ssh/id_ed25519
debug1: Will attempt key: /Users/dad/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/dad/.ssh/id_rsa RSA SHA256:/2EjDyRz3HYYyLqEegdjzEy2PfgIGnMNXvwbPzMgRqg
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/dad/.ssh/id_dsa
debug1: Trying private key: /Users/dad/.ssh/id_ecdsa
debug1: Trying private key: /Users/dad/.ssh/id_ed25519
debug1: Trying private key: /Users/dad/.ssh/id_xmss
debug1: No more authentication methods to try.
root@xxxxx: Permission denied (publickey).
Any idea how to deal with this issue?
Solution
I have been able to solve this and will explain how.
My issue was my password was not being accepted even after resetting the password in the droplet.
"Password not accepted in the console" info can be found here https://docs.digitalocean.com/products/droplets/resources/troubleshooting-ssh/authentication/
I followed the Boot into the Recovery process linked here: https://docs.digitalocean.com/products/droplets/resources/recovery-iso/#boot-into-the-recovery-iso
- Power down or stop droplet
- Select boot from recovery ISO
- Turned on the droplet again
- clicked the console
At this stage I was present with a list of options.
- Mount your Disk Image [Not Mounted]
- Check Filesystem
- Reset Droplet Root Password
- Configure Keyboard
- Attempt to 'chroot' into installed system
- Interactive Shell [/bin/bash] Choose (1-6) and press Enter to continue.
I selected option 1, then 3, followed by 6.
After this I powered off the droplet and selected boot from hard drive.
Accessing the console I was able to login and enter the password which was accepted and the ghost install began and completed successfully.
I hope this helps anyone who is experiencing the same issue.
Answered By - PT-83