Permission denied (publickey) ( Using Ubunut Snap)

I installed gittea via snap , Everything works but SSH Cloning is not working. Permission denied (publickey).

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

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?

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.

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.

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.