# Permission denied (publickey) ( Using Ubunut Snap)

**URL:** <https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423>\
**Category:** Install/Maintain/Configure\
**Created:** [December 17, 2022, 2:21pm UTC](https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423 "2022-12-17T14:21:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![v3ss0n](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/v3ss0n/32/3305_2.png) [@v3ss0n](https://forum.gitea.com/u/v3ss0n)\
**Post date:** [December 17, 2022, 2:21pm UTC](https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423/1 "2022-12-17T14:21:09Z")

</div>

I installed gittea via snap , Everything works but SSH Cloning is not working.

```auto
git@git.home.tech: Permission denied (publickey).

```

gittea-builtin-ssh server is configured to run at port 3322

```auto
LISTEN 0 128 *:3000 *:* users:(("gitea",pid=6066,fd=14))                                                                    
LISTEN 0 128 *:3322 *:*    

```

I had setup sshkey properly , verified , and when i tried to pull i just got permission denied (publickey) error …

How to get SSH working?

---

<div class="post-metadata">

**Author:** ![blaisep](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/blaisep/32/2818_2.png) [@blaisep](https://forum.gitea.com/u/blaisep)\
**Post date:** [December 18, 2022, 6:54pm UTC](https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423/2 "2022-12-18T18:54:03Z")

</div>

your git ssh client needs to be able to talk to it.  
so something has to do portforwarding to the gitea-builtin-ssh server on 3222.  
I’m having a similar problem on Kubernetes.

There seem to be so many ways to do this that no one has an opinionated recipe yet.

---

<div class="post-metadata">

**Author:** ![roeland](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@roeland](https://forum.gitea.com/u/roeland)\
**Post date:** [January 21, 2023, 8:24pm UTC](https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423/3 "2023-01-21T20:24:09Z")

</div>

I noticed `authorized_keys` is inside the snap folder and got it working by linking it to the correct place.  
Something like this:

> ln -s ~/snap/gitea/current/.ssh/authorized\_keys ~/.ssh/authorized\_keys

Make sure you create .ssh with chmod 700

Snap puts files on strange places.

---

<div class="post-metadata">

**Author:** ![delvh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/delvh/32/5047_2.png) [@delvh](https://forum.gitea.com/u/delvh)\
**Post date:** [January 21, 2023, 8:28pm UTC](https://forum.gitea.com/t/permission-denied-publickey-using-ubunut-snap/6423/4 "2023-01-21T20:28:24Z")

</div>

I don’t know that much about snap, but I would be cautious with your solution:  
If I’m not mistaken, `current` is only a symlink to an actual version.  
Thus, your issue will most likely reappear once Gitea is updated (which snap likes to do automatically without any admin knowing), and hence the target of `current` is changed.
