权限被拒绝:无法创建/dev/null

权限被拒绝:无法创建/dev/null

我已经尝试让 github 提交图表 hack 工作大约一周了。

这个https://github.com/mavrk/github-graffiti

和这个https://github.com/gelstudios/gitfiti

和这个https://github.com/NunoPinheiro/github-contributions-drawer

还有其他一些人...

它们都需要运行 bash 文件,但我从未这样做过,也不知道该怎么做。它看起来像这样:

#!/usr/bin/env bash
REPO=Gitfiti
git init $REPO
cd $REPO
touch README.md
git add README.md
touch gitfiti
git add gitfiti
GIT_AUTHOR_DATE=2017-10-24T12:00:00 GIT_COMMITTER_DATE=2017-10-24T12:00:00 git commit --allow-empty -m "gitfiti" > /dev/null
... bunch more commits here ...
git remote add origin [email protected]:MarynaLongnickel/$REPO.git
git pull origin master
git push -u origin master

目前,运行 bash 文件会出现错误:

: Permission deniedgitfiti.sh: cannot create /dev/null
: Permission deniedgitfiti.sh: cannot create /dev/null
: Permission deniedgitfiti.sh: cannot create /dev/null
: Permission deniedgitfiti.sh: cannot create /dev/null
: Permission deniedgitfiti.sh: cannot create /dev/null

所以我尝试一次运行一行,看看它在哪里中断。结果发现它开始git pull origin master抛出错误:

fatal: remote origin already exists.
fatal: Invalid refspec 'master?'
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

所以我去调查了......并找到了这个页面https://help.github.com/articles/error-permission-denied-publickey/其中说:

“为了确保您连接到正确的域,您可以输入以下命令:”ssh -vT [email protected]

后来没用,我就来到了这里。

这是整个错误

OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.253.112] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/solarmew/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4
debug1: Remote protocol version 2.0, remote software version libssh_0.7.0
debug1: no match: libssh_0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:secretkeyhereorsomething
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/solarmew/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/solarmew/.ssh/id_rsa
debug1: Trying private key: /home/solarmew/.ssh/id_dsa
debug1: Trying private key: /home/solarmew/.ssh/id_ecdsa
debug1: Trying private key: /home/solarmew/.ssh/id_ed25519
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).

答案1

您的另一个问题似乎是您没有通过 GitHub 的身份验证,而是尝试在没有登录帐户的情况下进行提交。尝试遵循本指南:https://help.github.com/articles/connecting-to-github-with-ssh/,这将向您展示如何添加无密码登录,以便您可以

主要问题似乎git commit --allow-empty -m "gitfiti" > /dev/null是唯一引用 /dev/null 的行,它应该在大多数发行版/操作系统上默认创建。您当前运行什么linux/unix?可能是您的操作系统不兼容,或者没有足够的权限来访问 /dev/,在这种情况下,操作系统有点糟糕。

相关内容