拒绝许可,请重试github
我想在使用 git push 命令时将文件自动上传到我的服务器。但是问题在于,它停止在键并给出错误(加载密钥“ /home/runner/.ssh/key”:无效格式)。在托管上,在GitHub存储库的设置中添加了键。也许有人面对类似的人?该问题如何解决?
upd:我通过更改键的输出来修复了错误,但是出现以下内容。.写入访问拒绝< /a>。
这是更新的代码:
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup key
- run: set -eu
- run: mkdir "$HOME/.ssh"
- run: echo "${{ secrets.key }}" > "$HOME/.ssh/key"
- run: chmod 600 "$HOME/.ssh/key"
# Deploy
- run: rsync -e "ssh -p 1022 -i $HOME/.ssh/key -o StrictHostKeyChecking=no" --archive --compress --delete . *server*:/*link*/public_html/
错误代码:
Run rsync -e "ssh -p 1022 -i $HOME/.ssh/key -o StrictHostKeyChecking=no" --archive --compress --delete . *server*:*link*/public_html/
Warning: Permanently added '*server*,[*IP*]:1022' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Received disconnect from *IP* port 1022:2: Too many authentication failures
Disconnected from *IP* port 1022
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
Error: Process completed with exit code 255.
I'd like to have files automatically uploaded to my server when using the git push command. But the problem is that it stops at the keys and gives an error ( Load key "/home/runner/.ssh/key": invalid format ). On the hosting, the keys are added, in the settings of the github repository - too. Maybe someone faced similar? How can this problem be solved?
UPD: I fixed the error by changing the output of the key, but the following appeared .. Writes access denied.
Here is the updated code:
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup key
- run: set -eu
- run: mkdir "$HOME/.ssh"
- run: echo "${{ secrets.key }}" > "$HOME/.ssh/key"
- run: chmod 600 "$HOME/.ssh/key"
# Deploy
- run: rsync -e "ssh -p 1022 -i $HOME/.ssh/key -o StrictHostKeyChecking=no" --archive --compress --delete . *server*:/*link*/public_html/
Error code:
Run rsync -e "ssh -p 1022 -i $HOME/.ssh/key -o StrictHostKeyChecking=no" --archive --compress --delete . *server*:*link*/public_html/
Warning: Permanently added '*server*,[*IP*]:1022' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Received disconnect from *IP* port 1022:2: Too many authentication failures
Disconnected from *IP* port 1022
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
Error: Process completed with exit code 255.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
尝试将密钥文件和文件夹.SSH权限更改为
最后,您的主目录不应由小组或其他人(最多755(drwxr-xr-x)))
http://linuxcommand.org/lc3_man_pages/ssh1.html
Try to change key file and folder .ssh permissions to
lastly your home directory should not be writeable by the group or others (at most 755 (drwxr-xr-x))
http://linuxcommand.org/lc3_man_pages/ssh1.html