I can't understand. I successfully login on my remote host with ssh during job and i want to be sure that I can run commands at this host. So I have job like this:
Deliver image to host:
stage: deploy
before_script:
# Setup SSH deploy keys
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- mkdir -p ~/.ssh
- echo "$PRIVATE_SSH" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh/id_rsa
script:
- ssh -o StrictHostKeyChecking=no <user>@<ip>
- ls
And ls give me output of gitlab runner machine: i see my repository, not items of remote machine.
Why? How should I run commands on remote?