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

Permission denied (publickey) #188

Open
toFrankie opened this issue Mar 22, 2024 · 4 comments
Open

Permission denied (publickey) #188

toFrankie opened this issue Mar 22, 2024 · 4 comments

Comments

@toFrankie
Copy link

「Github 同步到 Gitee」

两端的私钥、密钥、Token 那些都正确配置了,尝试过重新生成,也不行。搜索过一些相关的 Issue(比如 #108)看起来配置都没问题

其中 id_rsa 配置到 github 里的 Actions secrets and variables,也就是 GITEE_PRIVATE_KEY,其中 id_rsa.pub 也配置到 Gitee 里了。GITEE_TOKEN 也配置了,就是不成功。

@Yikun 大佬 help~

name: Sync to Gitee
on:
  push:
    branches:
      - main
jobs:
  repo-sync:
    name: Sync GitHub to Gitee
    runs-on: ubuntu-latest
    steps:
      - name: Mirror the GitHub repos to Gitee
        uses: Yikun/hub-mirror-action@master
        with:
          src: github/toFrankie
          dst: gitee/frankie_li
          dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
          dst_token: ${{ secrets.GITEE_TOKEN }}
          static_list: 'blog'
          account_type: user
          force_update: true
          debug: true

主要报错如下:

Cmd('git') failed due to: exit code(128)
  cmdline: git push -f gitee refs/remotes/origin/*:refs/heads/* --tags --prune
  stderr: '[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

配置没错:

image image image
@Yikun
Copy link
Owner

Yikun commented Mar 22, 2024

其中 id_rsa 配置到 github 里的 Actions secrets and variables,也就是 GITEE_PRIVATE_KEY,其中 id_rsa.pub 也配置到 Gitee 里了。

看着操作没问题。但错误显示的是push的权限有问题(就是gitee上可以的问题),重点检查这俩:

  1. id_rsa 配置到 github 里的 Actions secrets and variables的GITEE_PRIVATE_KEY
  2. id_rsa.pub 也配置到 Gitee 里了。

确保id_rsa正确且有权限,可以在本地push测试下。

@toFrankie
Copy link
Author

其中 id_rsa 配置到 github 里的 Actions secrets and variables,也就是 GITEE_PRIVATE_KEY,其中 id_rsa.pub 也配置到 Gitee 里了。

看着操作没问题。但错误显示的是push的权限有问题(就是gitee上可以的问题),重点检查这俩:

  1. id_rsa 配置到 github 里的 Actions secrets and variables的GITEE_PRIVATE_KEY
  2. id_rsa.pub 也配置到 Gitee 里了。

确保id_rsa正确且有权限,可以在本地push测试下。

试了下,本地推拉都是正常的。

@Grow-Willing
Copy link

我也遇到这个问题了,rsa密钥有密码就会验证失败,新建一个空密码的密钥就能成功

@Yikun
Copy link
Owner

Yikun commented Apr 26, 2024

不知道最后解决没,如果解决了可以分享下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants