# Can not clone from ssh

**URL:** <https://forum.gitea.com/t/can-not-clone-from-ssh/5002>\
**Category:** Install/Maintain/Configure\
**Created:** [April 8, 2022, 6:17am UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002 "2022-04-08T06:17:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yangzheng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/yangzheng/32/2559_2.png) [@yangzheng](https://forum.gitea.com/u/yangzheng)\
**Post date:** [April 8, 2022, 6:17am UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/1 "2022-04-08T06:17:15Z")

</div>

OS：centos7  
Gitea Version: 1.16.5

I add SSH key to my account.

 ![tempsn1ip](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/7/781c92c3ee3e6b11858af7a2e13eeb1fc83e8ed2.png)

connect correct.

![tempsn22ip](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/7/749805ebf0e83674a201109f87556d9dc10c1773.png)

But I can not clone from SSH。Cloning from https works fine.

 ![tempsnip](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/0/0f7ebe61bc2be98e08521cdb5c79596f9733630b.png)

How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [April 8, 2022, 7:16pm UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/2 "2022-04-08T19:16:55Z")

</div>

You’ll need to find out what the “internal error” is. You can find more about which logs you’ll need to configure/look at here: [Advanced: Logging Configuration - Docs](https://docs.gitea.io/en-us/logging-configuration/#debugging-problems)

---

<div class="post-metadata">

**Author:** ![yangzheng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/yangzheng/32/2559_2.png) [@yangzheng](https://forum.gitea.com/u/yangzheng)\
**Post date:** [April 9, 2022, 12:06pm UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/3 "2022-04-09T12:06:50Z")

</div>

Thank you for your help.  
I have got the error log detail,and repaired.Now,everything is OK.

 ![捕333获](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/0/07fb01f5e423c8f70baf3df754d1a64416c8722c.png)

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [April 15, 2022, 12:48am UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/4 "2022-04-15T00:48:48Z")

</div>

That means, you haven’t add git to ssh user git’s PATH. A simple way is to add git to a global PATH.

---

<div class="post-metadata">

**Author:** ![yangzheng](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/yangzheng/32/2559_2.png) [@yangzheng](https://forum.gitea.com/u/yangzheng)\
**Post date:** [April 15, 2022, 1:48am UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/5 "2022-04-15T01:48:15Z")

</div>

loged in as root

add “export PATH=$PATH:/usr/local/git-2.35.1/bin” to /etc/profile

Then run “source /etc/profile”  
and run “git --version”  
It is fine.

logged as git

add “export PATH=$PATH:/usr/local/git-2.35.1/bin” to /home/git/.bash\_profile

and run “git --version”  
It is fine.

However,the problem is still not solved.

I add soft link to “/usr/local/bin/” like this:

ln -s /usr/local/git-2.35.1/bin/git /usr/local/bin/git  
ln -s /usr/local/git-2.35.1/bin/git-upload-pack /usr/local/bin/git-upload-pack  
ln -s /usr/local/git-2.35.1/bin/git-receive-pack /usr/local/bin/git-receive-pack  
ln -s /usr/local/git-2.35.1/bin/git-cvsserver /usr/local/bin/git-cvsserver  
ln -s /usr/local/git-2.35.1/bin/gitk /usr/local/bin/gitk  
ln -s /usr/local/git-2.35.1/bin/git-shell /usr/local/bin/git-shell  
ln -s /usr/local/git-2.35.1/bin/git-upload-archive /usr/local/bin/git-upload-archive

problem solved.

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [June 9, 2022, 1:15pm UTC](https://forum.gitea.com/t/can-not-clone-from-ssh/5002/6 "2022-06-09T13:15:00Z")

</div>


