How to get ssh connection details from the commandline?

I know I can find ssh connection info from the management console, but I’d prefer not to switch out of my terminal to get this each time, or I want to automate a connection from a process of my own.

I don’t recognise the IDs in that connection string, do they change?

The ssh connection string provided in your projects management console can also be found from the CLI if you have already installed and authenticated with the platform cli tool.

The easiest way to ssh in directly from the cli is just with:

platform ssh

but if you want to get the ssh connection string that it’s using directly, you can use

$ platform ssh --pipe

which will return something like:

yh3p3drn4gglu-master-7rqtwti--playbook@ssh.au.platform.sh

This pattern is usually in the form $PROJECT-$ENV-$SLUG--$APP@ssh.$REGION.platform.sh, and is not expected to change over time.

Note that the ‘user’ part of the connection string seen here is used for routing to your project, and is not the userid you end up with on the box.