Load environment variables

It would be nice to be able to load custom environment variables from a file, or alternatively, run a command in the created shell. I'm trying to use CoreTunnel to connect through aws ssm, but the credentials need to be loaded in the environment. Does CoreShell allow you to specify a command when opening? I downloaded it, but I couldn't find anything like that.

Hi Nate,

What environments you'd like to load? Could you please elaborate how you load and utilize custom environments in command line?

Kindly Regards,

Yang

Hi Yang,

I'd like to connect to an Amazon RDS instance. We use SSM to authenticate, which requires specific environment variables to be set. I can manual create the tunnel after authenticating in my shell and it works, but I'd like to be able to use CoreTunnel instead.

Ideally, there would be a way to bootstrap the shell CoreTunnel uses that could respond to requests for input (I need to provide a 2fa to authenticate), but I believe that the credentials also get written to a file, so if I could source that file, that should work too.

Hi Nate, I'm not a user of SSM authentication, in theory, Core Tunnel should be able to work with it.

I googled for keywords "ssh ssm authentication environment", and I found these might help:

https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started-enable-ssh-connections.html

Another thing worth to mention, so far as I know, although OpenSSH has SendEnv, SetEnv and AcceptEnv (server side) directives for passing environment variables, but it may not work on authenticating stage.

SSM-Agent or ProxyCommand should be the right direction for non-interactive ssh login.

Yang

I got it working by writing a custom script for ProxyCommand, but because nothing on my path is available, I had to modify the aws connection script to use the full path for the session manager plugin.