Connecting to db with ssh on metabase for mac

Hello guys,

I’m running the metabase for mac version 0.34.4 and I’m trying to connect to amazon redshift through a ssh connection that don’t have user and password. Only an SSH key

I don’t really understand how this should work but I tried so create a ssh tunnel with a command like this:
ssh -i “my/key/location/key-name” -N -L localhost:6800:aws_rds_cluster:5432 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 my-user@bastion-ec2.domain

Am I doing this port forward correctly? what should I put on my db connection host? localhost, bastion-ec2 or the actual db_host?

Thanks in advance!

Hi @imossinato
You’re using 0.35.4 - version 0.36.0 will introduce SSH keys
Only quickly looked at the ssh command, but it looks correct. Then you would setup the connection in Metabase to point to host localhost on port 6800
https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html#what-if-the-built-in-ssh-tunnels-dont-fit-my-needs

Thanks for the response, @flamber

I could connect setting the door and the host but I keep getting this error message:
[Amazon](600000) Error setting/closing connection: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Don’t know if this is a fail on my permission or there is a server side permission that I don’t have.
If I have any update on this I’ll post it here

Regards!

@imossinato You should not use SSH-tunnel in Metabase, since the tunneling is handled by you manually outside of Metabase.