title: Permission denied in Gitlab Runner
body: <p>I have a Gitlab runner running in a VPS, now is facing this error:</p>
  <pre><code>Running on vps...
  Getting source from Git repository
  00:02
  Fetching changes with git depth set to 50...
  Reinitialized existing Git repository in /home/gitlab-runner/builds/-Jgf7oJG/0/agency/project/app/.git/
  Checking out 67b23db2 as testing...
  Removing .env
  Skipping Git submodules setup
  Executing &quot;step_script&quot; stage of the job script
  00:00
  $ mkdir -p ~/.ssh
  $ echo &quot;$SSH_PRIVATE_KEY&quot; | tr -d '\r' &gt; ~/.ssh/id_rsa
  $ chmod 700 ~/.ssh/id_rsa
  $ eval &quot;$(ssh-agent -s)&quot;
  Agent pid 929369
  $ ssh-add ~/.ssh/id_rsa
  Identity added: /home/gitlab-runner/.ssh/id_rsa (/home/gitlab-runner/.ssh/id_rsa)
  $ ssh-keyscan -H $SSH_HOST &gt;&gt; ~/.ssh/known_hosts
  bash: line 133: /home/gitlab-runner/.ssh/known_hosts: Permission denied
  Cleaning up file based variables
  00:00
  ERROR: Job failed: exit status 1
  </code></pre>
  <p>I've tryed with the following commands inside the vps that have the runner:</p>
  <pre><code>$ sudo usermod -a -G sudo gitlab-runner
  
  $ sudo visudo
  </code></pre>
  <p>And adding this to the bottom of the file.
  gitlab-runner ALL=(ALL) NOPASSWD: ALL</p>