Header

Adding known hosts to your build process

During the build process, your commands may attempt to make an SSH connection to another service such as Github, Codebase or another host. By default we allow connections to any service, however you may manually define hostnames and public keys here to restrict what servers can be connected to with SSH during your build.

Known Hosts

To define a known host, select Known Hosts on the left hand side of the page in your propject, then click the New Known Host button at the top:

New Known Host

Add a description for your host firstly, the public host key below, then click Create Known Host to finish.

Retrieving the host key

When adding a new known host, if you don't know the hostkey, you can obtain it with the command ssh-keyscan -t rsa example.com | cut -d ' ' -f 2-3. The example below shows the command to retrieve the host key for Codebase:

$ ssh-keyscan -t rsa codebasehq.com 2>/dev/null | cut -d ' ' -f 2-3

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqafgFtYVquYfReJa3MGIyGz0RZoc1kfnXHFDjprY4Uy0lwia+35rRa9Aycrf4eySa55JXsg7rOosqpNOi2hSFWHQ/FfKzMH077Vu1X6d5gNBzxR3aJq/zaAJSiRbrUM20NgEHzBiT8x+32zM71E4qjKnGG8AdEqV9AmROXHWddLSs3e5Tsr2+Dkc/lu+Ko4eVjFjW3ZUgTRE3VTd+PDSRGOfmimgBpcuhkBbEyK4+dq7NJKxLbUl9zC7jKPddkWpbonR9CYWj+c8R8MimKLhhSilNRUKuQBNYydol3eX8VNi+PTzAYtB/w8/jl3+BWzj6xAyfMRdeJDyhhTYX+/s+w==