构建gerrit server 遇到Permission denied (publickey)错误
knight@knight-linux:~$ review_site/bin/gerrit.sh start
Starting Gerrit Code Review: OK
knight@knight-linux:~$ ssh -vv -p 29418 localhost gerrit create-project --name new/project
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 29418.
debug1: Connection established.
debug1: identity file /home/knight/.ssh/identity type 0
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /home/knight/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /home/knight/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: Remote protocol version 2.0, remote software version GerritCodeReview_2.2.2-rc0 (SSHD-CORE-0.5.1-R1095809)
debug1: no match: GerritCodeReview_2.2.2-rc0 (SSHD-CORE-0.5.1-R1095809)
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-md5-96,hmac-sha1-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-md5-96,hmac-sha1-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 131/256
debug2: bits set: 1025/2048
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host '[localhost]:29418' is known and matches the RSA host key.
debug1: Found key in /home/knight/.ssh/known_hosts:5
debug2: bits set: 994/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/knight/.ssh/id_rsa (0xb8d10338)
debug2: key: /home/knight/.ssh/id_dsa (0xb8d10350)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/knight/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Offering public key: /home/knight/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
-------------------------------------------------------------------------------
并且按照网上改/etc/ssh/sshd.config也不行,有成功搭建gerrit的帮忙看看,分享下你们的成功经验,thx!
相关推荐
2025年自建Git服务选型指南:Gitea、GitLab与Gerrit部署实战
在代码托管与DevOps实践中,Git服务选型直接影响团队协作效率与运维成本。自建Git服务通过本地化部署实现代码可控与合规,其核心原理在于平衡功能、资源与安全。技术价值体现在降低长期订阅成本、满足数据主权要求,并支持定制化CI/CD流水线。典型应用场景包括小团队轻量协作、中大型团队完整DevOps平台以及严格代码评审流程。Gitea以轻量易用见长,GitLab提供一体化DevOps能力,Gerrit专注严谨评审。本文深入对比三款工具,涵盖部署配置、问题排查与选型建议,助力团队高效搭建自建Git服务。
Rocky Linux 9 SSH密钥配置实战:ed25519免密登录与VS Code远程开发
SSH密钥认证是Linux系统安全访问的基础机制,其核心在于非对称加密实现的身份强验证——私钥本地保管、公钥服务端部署。相比传统密码,它杜绝暴力破解、支撑自动化运维,并为VS Code Remote-SSH等现代开发工具提供可靠连接基础。Rocky Linux 9默认采用ed25519算法,兼顾高性能(256位密钥)、高安全性(抗侧信道攻击)与轻量级部署。实际配置需严格遵循权限规范(如~/.ssh目录700、authorized_keys文件600),并依赖ssh-copy-id完成原子化写入与自动校验。本
CentOS 7 部署 Eclipse Theia 云 IDE 实战:Docker Compose + nginx-proxy 生产级架构
云 IDE 是指通过浏览器访问、后端运行在服务器上的集成开发环境,其核心依赖容器化部署、反向代理与安全认证三大能力。Eclipse Theia 作为模块化开源云 IDE,基于 Language Server Protocol 实现多语言支持,具备插件隔离与资源可控等工程优势。在 CentOS 7 这类长期服役的生产环境中,需特别关注内核兼容性(3.10.0)、Docker 存储驱动(overlay2)、密码策略审计(8位+4类字符)及 HTTPS 终止等关键环节。本文聚焦于使用 Docker Compose
从GitLab到Gitea:轻量级Git服务器迁移与资源优化实践
Git服务器是代码托管的核心基础设施,但传统方案如GitLab在功能强大的同时,也带来了极高的资源占用与维护成本。其原理在于内置了数据库、后台任务、缓存等多个组件,导致镜像体积和内存消耗居高不下。轻量级方案Gitea采用Go语言编写,以单进程、低内存的设计实现了近似的核心功能,镜像仅600MB左右,内存占用低至数百MB,大幅降低服务器压力。对于小团队、自托管、内网部署等场景,这种“少即是多”的思路能显著优化运维成本。从GitLab迁移到Gitea,不仅涉及仓库和权限的搬迁,还包括CI流程的适配,但整体切换成
CentOS 8 安装 Git 的三种方案与 SELinux 配置实战
Git 是分布式版本控制系统的核心工具,其在企业级 Linux 发行版中的部署远不止执行安装命令——需深入理解包管理机制、运行时安全模型(如 SELinux)与依赖兼容性原理。在 CentOS 8 这一默认启用模块化仓库(AppStream)、强制 SELinux enforcing 模式、全面转向 dnf 的 RHEL 系统中,Git 的安装决策直接影响 CI/CD 稳定性、代码审计合规性及跨平台协作体验。技术价值体现在:规避动态链接错误、保障 SSH 认证通过、实现 HTTPS 代理穿透与换行符自动标准


