# Issues with git clone + ssh in pipeline

**URL:** <https://drone.discourse.group/t/issues-with-git-clone-ssh-in-pipeline/10291>\
**Category:** Drone Support\
**Created:** [January 2, 2022, 3:19pm UTC](https://drone.discourse.group/t/issues-with-git-clone-ssh-in-pipeline/10291 "2022-01-02T15:19:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcushoff](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/marcushoff/32/2402_2.png) [@marcushoff](https://drone.discourse.group/u/marcushoff)\
**Post date:** [January 2, 2022, 3:19pm UTC](https://drone.discourse.group/t/issues-with-git-clone-ssh-in-pipeline/10291/1 "2022-01-02T15:19:39Z")

</div>

Hi, I have an issue with ssh keys.  
**.drone.yml:**

```auto
---
kind: pipeline
type: docker
name: default

steps:
- name: test
  image: python:3.9
  environment:
    SSH_KEY:
      from_secret: ssh_key
  commands:
  - mkdir $HOME/.ssh
  - echo "$SSH_KEY" > $HOME/.ssh/id_rsa
  - chmod 600 $HOME/.ssh/id_rsa
  - ssh-keyscan git.company.net > $HOME/.ssh/known_hosts
  - if [-f requirements.txt]; then pip install -r requirements.txt; fi
  - pip install pytest
  - pytest -v tests/* --junitxml=test-reports/report.xml

```

**requirements.txt:**

```auto
git+ssh://git@git.company.net/user/yangson.git

```

Output is:

```auto
Collecting git+ssh:// **** @git.company.net/user/yangson.git (from -r requirements.txt (line 1))
  Cloning ssh:// **** @git.company.net/user/yangson.git to /tmp/pip-req-build-2aedxflp
  Running command git clone -q 'ssh:// **** @git.company.net/user/yangson.git' /tmp/pip-req-build-2aedxflp
  Warning: Permanently added the ECDSA host key for IP address '192.168.123.7' to the list of known hosts.
  Permission denied, please try again.
  Permission denied, please try again.
  git@git.company.net: Permission denied (publickey,password).
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.

```

It’s a gitea repository and my public ssh key exists in it.  
What am I doing wrong here?

Thanks in advance
