0

I am trying to set up a digital ocean droplet for deployment with trellis but something has gone awry.

Im on windows, using vagrant im my project folder I try to ssh to it and get this readout:

vagrant@recfishwa:~$  ssh 198.166.218.143
Permission denied (publickey).

vagrant@recfishwa:~$  ssh -v 198.166.218.143
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 3: Applying options for *
debug1: /etc/ssh/ssh_config line 20: Deprecated option "useroaming"
debug1: Connecting to 189.166.218.143 [198.166.218.143] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/vagrant/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/vagrant/.ssh/id_ed25519-cert type -1
debug1: identity file /home/vagrant/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/vagrant/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 188.166.218.143:22 as 'vagrant'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: [email protected]
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: [email protected]
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-ed25519 SHA256:2R+kXXuJxz/ON3eeOmToiySqGtxCClQoXV98t9mmhNE
debug1: Host '188.166.218.143' is known and matches the ED25519 host key.
debug1: Found key in /home/vagrant/.ssh/known_hosts:6
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/vagrant/.ssh/id_ed25519
debug1: Offering RSA public key: /home/vagrant/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

I was hoping there would be a clue in there as I have run out of research. I did originally set the droplet up with an ssh I generated with putty_gen but have since deleted the key in settings and reset the root password in an attempt to gain access but no luck. I cannot even log into the DO console with the password for some reason even after the reset. Ihave reloaded vagrant. Im not sure if there is still a key associated with the droplet now. Anything obvious in the debug log?

Also can someone please confirm where I should store my keys on my local computer when running vagrant in my project dir and trying to connect to DO?

I also have cygwin configured with openssh and also Putty but still cannot connect no matter what I try.

2
  • i feel this question would be better placed on another of stack exchange areas. Super user?
    – ISMSDEV
    May 29, 2017 at 17:23
  • This sounds like a question for Server Fault.
    – 1234567
    May 29, 2017 at 17:26

1 Answer 1

1

Check /home/vagrant/.ssh/id_rsa for an existing RSA private SSH key. Make sure that the public key (should be located at /home/vagrant/.ssh/id_rsa.pub) exists on 188.166.218.143, or look at documentation for the command ssh-copy-id which will automatically copy the public key for you, providing that you have password authentication for the root (or whichever user you prefer) enabled. If you don't have the keys, generate them by using the command ssh-keygen -t rsa.

Otherwise, if you've totally locked yourself out of your droplet, you may need to open a support ticket with DigitalOcean... they're generally pretty good in their response times.

Vagrant usually copies the current user's SSH public key into the vagrant box. If this is broke, ensure that your key does exist in home directory (~/.ssh), and reinstall vagrant (save your instances and reinstall the package).

9
  • I have access now with the DO terminal. Will take the steps you have described and report back. Thanks.
    – JPB
    May 29, 2017 at 17:37
  • There is an existing public/private key pair in the folder you specified on the vm. I took the public key and added it to the DO account security settings and attempted to copy the public key to the remote with ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] but got the same error Permission denied (publickey).
    – JPB
    May 29, 2017 at 18:03
  • @JPB - have you recently regenerated your SSH keys on your droplet? When was the last time it was working? Secondly, root password login is often disabled by default (see available settings to change that option) at vagrantup.com/docs/vagrantfile/ssh_settings.html.
    – 1234567
    May 29, 2017 at 18:09
  • I have never had access to it tried to provision the server as part of the deploy and this is when I hit a roadblock. I suspect I have mucked something up with the keys. Would be nice to remove all keys from both servers and generate some fresh ones. will check the root access now but should be ok as I have gotten into the console on DO now as root.
    – JPB
    May 29, 2017 at 18:12
  • @JPB - please see groups.google.com/forum/#!topic/vagrant-up/mUNB182dY24, as it is the same issue as reported.
    – 1234567
    May 29, 2017 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .