# SSH Clone asks password

**URL:** <https://forum.gitea.com/t/ssh-clone-asks-password/8863>\
**Category:** Install/Maintain/Configure\
**Created:** [March 28, 2024, 4:01pm UTC](https://forum.gitea.com/t/ssh-clone-asks-password/8863 "2024-03-28T16:01:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeandloops](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@codeandloops](https://forum.gitea.com/u/codeandloops)\
**Post date:** [March 28, 2024, 4:01pm UTC](https://forum.gitea.com/t/ssh-clone-asks-password/8863/1 "2024-03-28T16:01:03Z")

</div>

I’ve installed a brand new Gitea server with a seperate gitea user running the gitea service.

After adding the SSH keys in gitea I’m not able to clone via SSH. using  
`ssh -T gitea@myhost` responds with a request for a gitea user password.

**What I’ve tried so far:**

- Verify authorized\_keys - No authorized\_keys config is generated by Gitea.
- Verify authorized\_keys file exists for the gitea user with .ssh 700 & 600 for the authorized\_keys file.
- SSH works for root user.
- Re-add SSH keys to Gitea after verifying the authorized\_keys exists for gitea user.
- Try to force this config to be created from Administration menu
- Try USE\_COMPAT\_SSH\_URI = true in the config file.
- I’m able to clone and push with https but this is not ideal for deployment scenarios.

How do I get Gitea to add my SSH key uploaded in the user profile to authorized\_keys? I think this is at the heart of the issues I’m seeing.

---

<div class="post-metadata">

**Author:** ![selfhoster\_va](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@selfhoster\_va](https://forum.gitea.com/u/selfhoster_va)\
**Post date:** [March 29, 2024, 10:20am UTC](https://forum.gitea.com/t/ssh-clone-asks-password/8863/2 "2024-03-29T10:20:31Z")

</div>

Have you followed these steps?

> **[Installation with Docker | Gitea Documentation](https://docs.gitea.com/installation/install-with-docker#ssh-container-passthrough)**
>
> Gitea provides automatically updated Docker images within its Docker Hub organization. It is

I had missed the part where I had to add the public key via the UI page and was trying to add content to the authorized\_keys directly.  
I ended up using 2 keys.  
1 for the gitea command to ssh from host/server to container.  
1 for the client to ssh into host/server  
Both keys need to be setup for the git user (or looks like gitea user for you)

I also had to ensure I had created the git user which I saw in this thread

> [@Setting up git user for ssh access](https://forum.gitea.com/t/setting-up-git-user-for-ssh-access/326/5):
>
> my error message was “This account is currently not available.” I create user with this options: adduser --system --group --disabled-password --home /etc/gitea gitea without any shell. The right way is: adduser --system --shell /bin/bash --group --disabled-password --home /etc/gitea gitea Thats why i can’t get via ssh.

The final thing for me since I was using 2 keys was to ensure I use ssh config file. I’m sure you would be able to do all this using a single key but when I used my approach I at least was able to get rid of the password issue.
