Does the `remote` command passed to a mix release binary need RELEASE_COOKIE to be set over SSH?

I’m trying to get an IEx shell to use recon on an Elixir app running in production:

$ ssh ubuntu@<host> /home/ubuntu/current/bin/<project-id> remote
warning: the --remsh option will be ignored because IEx is running on limited shell

Because this IEx session is running on a limited shell there is no navigation with the arrow keys (which give ^[[C, ^[[D,…). Any function call also comes back with 0 matches.

When I use the ssh -t command to force a tty shell and provide the RELEASE_COOKIE variable everything works as expected:

$ ssh -t ubuntu@<host> RELEASE_COOKIE=<cookie> /home/ubuntu/current/bin/<project-id> remote

Both arrow keys and :recon_tracer work in this shell.

What I find weird is that the tty shell without RELEASE_COOKIE does not work as it does without the -t option:

$ ssh -t ubuntu@<host> /home/ubuntu/current/bin/<project-id> remote
Connection attempt from node :"rem-eb50-<project-id>@" rejected. Invalid challenge reply. **

This command throws the following error in the production node logs:
Connection attempt from node :"rem-eb50-<project-name>@" rejected. Invalid challenge reply.

So I have two main questions:

  • Why does the IEx node not connect when using the ssh -t option while it works fine without?
  • Why does :recon_tracer not work when the --remsh option is ignored?

I would greatly appreciate anyone who can help me understand what is going on here.