Permission denied error while using private key inside .vagrant folder trellis (Sequel Pro)

I really don’t understand…

Used command:  /usr/bin/ssh -v -N -S none -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -o NumberOfPasswordPrompts=3 -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 vagrant@syracusesedationandfamilydentistry.test -L 63215:127.0.0.1:3306

OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /Users/josephroberts/.ssh/config
debug1: /Users/josephroberts/.ssh/config line 2: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Control socket " none" does not exist
debug1: Connecting to syracusesedationandfamilydentistry.test [192.168.50.5] port 22.
debug1: fd 5 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/josephroberts/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/josephroberts/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2
debug1: match: OpenSSH_7.2p2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to syracusesedationandfamilydentistry.test:22 as 'vagrant'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-ed25519 SHA256:YD4Fbjv6igUaXf2u7OfZtgYndkdf31qK0IejP3tyuGk
debug1: Host 'syracusesedationandfamilydentistry.test' is known and matches the ED25519 host key.
debug1: Found key in /Users/josephroberts/.ssh/known_hosts:7
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
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: Offering public key: RSA SHA256:Y/z9kDW8GcXFTZiB9s2CnGOv/LSMT6LTTstsNvZobBI /Users/josephroberts/.ssh/id_rsa_github_broskees
debug1: Authentications that can continue: publickey
debug1: Offering public key: RSA SHA256:wkUvAYzNownWkBoIycBddy3exs9YUQvFRdo/o+j75eI /Users/josephroberts/.ssh/id_rsa_digitalocean
debug1: Authentications that can continue: publickey
debug1: Offering public key: RSA SHA256:es275YAhm/Lfb4GjczUp/SjEGJGFKZphvTkx5gMamrA /Users/josephroberts/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
vagrant@syracusesedationandfamilydentistry.test: Permission denied (publickey).

According to the log, it appears Sequel Pro isn’t even trying to use the .vagrant\....\private_key?

I tried to add it to my ~/.ssh/config (shown below) then add it to my ssh agent with ssh add -K path/to/key. No Bueno. What’s going on here?

Host 192.168.50.5
  User vagrant
  Port 2222
  IdentityFile /Users/josephroberts/localdev/syracusesedationandfamilydentistry.com/trellis/.vagrant/machines/default/virtualbox/private_key

Try these adjustments:

  • uncheck the Connect using SSL box (see your screenshot). You want SSH.
  • put private_key file path in the SSH Password field (click the field’s :key: key icon)

If that doesn’t work, run

$ cd /localdev/syracusesedationandfamilydentistry.com/trellis

$ vagrant ssh-config

Use the output SSH configs in your ~/.ssh/config instead of what you pasted above, but with different Host value. Example:

# ~/.ssh/config
Host syracusesedationandfamilydentistry.test
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/josephroberts/localdev/syracusesedationandfamilydentistry.com/trellis/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes
2 Likes