Sequel pro + ssh to vagrant

This might help. It’s really a laravel tutorial, but it’s a similar setup with a digital ocean vps.

The beginning of the video doesn’t apply, around the middle he explains how to use sequel pro to connect via ssh. Hope it works.

I am able to connect using the private _key and DB credentials for the specific box.

When trying to SSH I get

The authenticity of host ' (' can't be established.
RSA key fingerprint is 6e:86:1a:f1:84:9e:92:b8:c3:fe:bd:cd:e9:e1:e2:df.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Warning: the RSA host key for '' differs from the key for the IP address ''
Offending key for IP in /Users/username/.ssh/known_hosts:4
Are you sure you want to continue connecting (yes/no)? yes
Permission denied (publickey).
MacBook-Pro:~ username$

I recently started toying with OpenSSH certs, I’m thinking this is what is causing the issue.

Reading the Vagrant docs, this could be where my issue sits

To configure SSH access with the insecure keypair, place the
public key into the ~/.ssh/authorized_keys file for the "vagrant" user.
Note that OpenSSH is very picky about file permissions.
Therefore, make sure that ~/.ssh has 0700 permissions and
the authorized keys file has 0600 permissions.

When Vagrant boots a box and detects the insecure keypair, it will
automatically replace it with a randomly generated keypair for additional
security while the box is running.

I noticed that when I Vagrant Up I get Vagrant insecure key detected. which Vagrant then replaces. This looks like I’ve messed my SSL certs and I am at a loss on how to address it.

If I try and ssh I can shell right in. However if I ssh I get permissions denied.

I can still run from within the site folder vagrant ssh. Should I be looking to replace the SSL certs manually within each site that I have this problem?

Still can’t connect to database using Sequel Pro. Tried all configs possible for SSH and also tried direct connection.

@buretta Try this example: Brain imploding trying to get bedrock + bedrock-ansible running... please help
No idea why the ip doesn’t work since it’s binded to mysql and in the vagrant ssh-config readout. Maybe a key for that IP already exists in known_hosts.

I’ve removed all key’s for that host, I can also re-produce this issue on 2 separate machines.

When I try to ssh in Sequel Pro with the suggested setup I get the follow error

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug1: Connecting to [] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/username/.vagrant.d/insecure_private_key type -1
debug1: identity file /Users/username/.vagrant.d/insecure_private_key-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr none
debug1: kex: client->server aes128-ctr none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 01:a6:9a:a0:fb:b8:4f:95:93:77:f0:67:89:45:8e:ca
debug1: Host '' is known and matches the RSA host key.
debug1: Found key in /Users/username/.ssh/known_hosts:9
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/username/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/username/.vagrant.d/insecure_private_key
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

Also having problems with this :confused:

I’m wondering if it’s a particular version that we are having troubles with.

When did you pull Trellis? Mine was setup with this being the last commit , Aug 28, 2015

I pulled trellis last friday

You have SSL enabled for development env?

What version of Vagrant are you running? vagrant --version

I’m running Vagrant 1.7.4

I was able to finally get this working, however I am hesitant to say it’s the correct way. Maybe others can chime in and provide better insight.

Vagrant changed the behaviour between 1.6 and 1.7 versions and now will insert auto generated insecure key instead of the default one. I’m still learning, but to continue working and ssh into the VM I applied config.ssh.insert_key = false into the vagrant file and then re-provisioned the VM. Below is a reference to where I added this, line 28.

25. Vagrant.configure('2') do |config|
26. = 'ubuntu/trusty64'
27.  config.ssh.forward_agent = true
28.  config.ssh.insert_key = false

Once the above was added and the VM reloaded I was able to use Sequel with the following config
mySQL host:
username: name_used_in_group_vars/devlopment/wordpress_sites.yml
password: pass_used_in_group_vars/devlopment/wordpress_sites.yml
ssh user: vagrant
ssh key:

I haven’t tested this across other projects yet.

What I need to further learn is the proper way to setup vagrant. Looking into the docs I believe I have not setup my authenticated_keys which seems to be the reason (at least in vagrant 1.7) why I ran into trouble all of a sudden. I had this setup but then things went to sideways for no clear reason or what changed…keeping in mind I’m flying solo and reading all the docs AND work gets a bit much and likely missed some clear statement about a certain change.


I wasn’t able to connect with the ssh key path shown in other instructions in the forum (the one in the .vagrant.d folder).

I changed it to this and now it works!

Thanks buretta.


so where exactly did you change what? :slight_smile: @ericgauvin and @buretta

I tried it with and without
config.ssh.insert_key = false

My exception

Used command:  /usr/bin/ssh -v -N -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -   o NumberOfPasswordPrompts=3 -i    /Users/fabianhenzler/Development/_marketplace/.vagrant/machines/default/virtualbox/private_key -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 -L 54107/

Bad local forwarding specification ' 54107/'

also tried with all or

You click the blue “key” button in the sequel pro gui. Then navigate to that place on your computer.

Here’s what seems to work all in one place:

Some things to note:

  • The name at the top is just the name of your connection favorite, so name it something that won’t be confusing later (the thing to remember is it’s not part of the connection and it should make sense when you come in later and want to use the favorite)
  • sometimes when you clikd the “SSH” tab in sequel pro, it doesn’t show the whole form, you need to toggle between tabs to make it show the whole form (at least for me)
  • use the database username and password that’s in your wordpress_sites.yml file
  • the database name is also in the wordpress_sites.yml file, but it’s optional. You can select a database in sequel pro with the dropdown menu after you connect if you want
  • the ssh key that worked for me was to click the blue key button and navigate to > .vagrant > machines > default > virtualbox > private_key
  • I had a problem with the ssh connection and I went into .ssh/known_hosts and deleted the row for I used sudo. I used nano, locate the line and use Ctrl + K to delete the line.

Today I upgraded to el capitan. Not sure if it was related, but I was unable to connect with sequel pro. It was driving me nuts. Eventually I noticed there was an update for sequel pro. Am able to connect again.

1 Like