Why are my variables are not available in step phase

I am ssh-ing into my linux environment to deploy.

  1. I defined my variables SSH_USER and SSH_HOST in my project Environment Variables section.
  2. During the environment set up stage, I see that something is there
Using environment variables from project settings and/or contexts:
  CIRCLE_JOB=**REDACTED**
  SSH_HOST=**REDACTED**
  SSH_USER=**REDACTED**
  1. However, I get this error below
#!/bin/bash -eo pipefail
ssh $SSH_USER@SSH_HOST 'sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -'
ssh: Could not resolve hostname ssh_host: Name or service not known

Exited with code exit status 255
  1. It does work if I hardcode by ssh values but then I have to commit them to git. My config file is below. Can anyone assist in explaining why this is not working?
version: 2.1
orbs:
  node: circleci/node@4.1.0

jobs:
  build:
    machine:
      enabled: true
    steps:
      - add_ssh_keys:
          fingerptints:
            - "my:fingerprint:is:here"
      - checkout
      - run:
          name: Installing nvm and node...
         #   does not work if i abstract into variables
         #    but it does work if I hard code SSH_USER and SSH HOST in here
          command: |
            ssh SSH_USER@SSH_HOST 'sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -'

workflows:
  build_and_test:
    jobs:
      - build

Hi @andre1620,

In the command ssh $SSH_USER@SSH_HOST 'sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -', you’re properly interpolating the SSH_USER variable by specifying “$SSH_USER”.

However, the SSH_HOST is not interpolated because you specified “SSH_HOST”; without the “$” (dollar sign).

I suggest replacing the command with:
ssh $SSH_USER@$SSH_HOST 'sudo curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -'