1

I tried to add generated ssh id_rsa to the gitlab-ci.

Command I have found is echo "$SSH_PRIVATE_KEY" | ssh-add -. I can not find any information about param - that was added to command ssh-add. How can I interprate this? In a man I have found information about running it without any argument and some flags but add single dash is not describe there. I used ubuntu latest image for this process

CezarySzulc
  • 1,849
  • 1
  • 14
  • 30
  • It's a reference to the standard input of the command, so the output of the piped `echo` – Aaron Sep 01 '21 at 10:17
  • So command `echo "$SSH_PRIVATE_KEY" > ssh-add` should also works? – CezarySzulc Sep 01 '21 at 10:23
  • `>` redirects to a file, you'd just be writing the private key in a file named `ssh-add`. If it worked as a pipe, it might still fail since you didn't write `-` this time and `ssh-add` might ignore its standard input (although that would surprise me) – Aaron Sep 01 '21 at 10:33

1 Answers1

1

As @Aaron said

It's a reference to the standard input of the command, so the output of the piped echo
CezarySzulc
  • 1,849
  • 1
  • 14
  • 30