Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH passthrough into Docker failed: Permission denied (publickey). #19365

Closed
Dexus opened this issue Apr 10, 2022 · 1 comment
Closed

SSH passthrough into Docker failed: Permission denied (publickey). #19365

Dexus opened this issue Apr 10, 2022 · 1 comment
Labels

Comments

@Dexus
Copy link
Contributor

Dexus commented Apr 10, 2022

Description

I tried https://docs.gitea.io/en-us/install-with-docker/#ssh-shell-with-authorizedkeyscommand and https://docs.gitea.io/en-us/install-with-docker/#docker-shell-with-authorizedkeyscommand

both end ma back

ssh -v -i "H:\Dropbox\...Josef.openssh" git@git.xxxx.biz
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\josef/.ssh/config
debug1: Connecting to git.xxxx.biz [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file H:\\Dropbox\\....Josef.openssh type -1
debug1: identity file H:\\Dropbox\\...Josef.openssh-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to git.xxxx.biz:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:JEDLiiKEi7sIjMyLNhHzeTBzUK8R0vpev9H8CqOlBys
debug1: Host 'git.xxxx.biz' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\josef/.ssh/known_hosts:5
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: H:\\Dropbox\\....Josef.openssh  explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: H:\\Dropbox\\...Josef.openssh
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
git@git.xxxx.biz: Permission denied (publickey).

/usr/bin/ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 /usr/local/bin/gitea keys -e git -u git -t ssh-rsa -k AAAAB3NzaC1y...

by Hand response to: Gitea: Invalid repository path

/usr/bin/docker exec -i -u git gitea /usr/local/bin/gitea keys -e git -u git -t ssh-rsa -k AAAAB.......

gives:

# gitea public key
command="/usr/local/bin/gitea --config=/data/gitea/conf/app.ini serv key-6",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-rsa AAAAB3NzaC1.....Josef.key

but I get always: `git@git.xxxx.biz: Permission denied (publickey).´ via external ssh /git clone

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.30.x

Operating System

docker

How are you running Gitea?

via docker

Database

MySQL

@Dexus Dexus added the type/bug label Apr 10, 2022
@Dexus Dexus changed the title SSH into Docker failed SSH into Docker failed: Permission denied (publickey). Apr 10, 2022
@techknowlogick techknowlogick changed the title SSH into Docker failed: Permission denied (publickey). SSH passthrough into Docker failed: Permission denied (publickey). Apr 13, 2022
@lunny
Copy link
Member

lunny commented Apr 20, 2022

duplicated with #17798

@lunny lunny closed this as completed Apr 20, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants