ビルド後github.ioにVueのCLIアプリをプッシュすることはできません - 許可が拒否されました(公開)

ワーウィック:

私がしましたtroubleshooted https://help.github.com/en/github/authenticating-to-github/error-permission-denied-publickey

  1. sudoコマンドはGitリポジトリを使用する必要がありますか?

私はgitのコマンドと一緒にsudoを使用していませんよ

  1. あなたは正しいサーバーに接続していることを確認してください

実行すると、$ ssh -vT [email protected]ポート22とリターンに接続しますYou've successfully authenticated

  1. 常に「gitの」ユーザーを使用

私は、SSHプロトコルと使用するようにレポを変更するには、set-urlコマンドを使用していたssh -T [email protected]リターンを:

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [140.82.118.4] port 22.
debug1: Connection established.
debug1: identity file /home/warwick/.ssh/id_rsa type 0
debug1: identity file /home/warwick/.ssh/id_rsa-cert type -1
debug1: identity file /home/warwick/.ssh/id_dsa type -1
debug1: identity file /home/warwick/.ssh/id_dsa-cert type -1
debug1: identity file /home/warwick/.ssh/id_ecdsa type -1
debug1: identity file /home/warwick/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/warwick/.ssh/id_ed25519 type -1
debug1: identity file /home/warwick/.ssh/id_ed25519-cert type -1
debug1: identity file /home/warwick/.ssh/id_xmss type -1
debug1: identity file /home/warwick/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0p1 Ubuntu-6build1
debug1: Remote protocol version 2.0, remote software version babeld-17f81433
debug1: no match: babeld-17f81433
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
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:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/warwick/.ssh/known_hosts:3
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: Will attempt key: /home/warwick/.ssh/id_rsa RSA SHA256:XUyMmE8J489MaD9Ix/1xJdilSU4aH/F27hdhQubMQL4
debug1: Will attempt key: /home/warwick/.ssh/id_dsa 
debug1: Will attempt key: /home/warwick/.ssh/id_ecdsa 
debug1: Will attempt key: /home/warwick/.ssh/id_ed25519 
debug1: Will attempt key: /home/warwick/.ssh/id_xmss 
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/warwick/.ssh/id_rsa RSA SHA256:XUyMmE8J489MaD9Ix/1xJdilSU4aH/F27hdhQubMQL4
debug1: Server accepts key: /home/warwick/.ssh/id_rsa RSA SHA256:XUyMmE8J489MaD9Ix/1xJdilSU4aH/F27hdhQubMQL4
Enter passphrase for key '/home/warwick/.ssh/id_rsa': 
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.118.4]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_ZA.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi WNortier! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3452, received 2484 bytes, in 0.5 seconds
Bytes per second: sent 6930.1, received 4986.7
debug1: Exit status 1
  1. 必ず、使用されているキーを持っています

私は、あたりとして新しい公開鍵/秘密鍵の組み合わせを作成しましたhttps://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account Identity added: /home/warwick/.ssh/id_rsa ([email protected])

ここでの問題があります:

開始eval "$(ssh-agent -s)"端子とランニングにはssh-add -l戻っているThe agent has no identities.私はちょうどこれを追加していても?

githubのにプロジェクトのsrcファイルへの変更を押すと、自分のパスワードのプロンプト私をせず、私はgithubの設定を確認するとき、私は、キーが使用されて参照してください。キーが動作しているように見えるので、

私は許可拒否(公開)私は、ビルドおよびプッシュを実行しようとするたびに実行します。私はVueのマニュアルの、このガイドに従って.deploy.shファイルを作成し、コメントを外し、ライン上で自分のユーザー名を追加github.ioプッシュするためのものhttps://cli.vuejs.org/guide/deployment.html#github-ページ

set -e
npm run build
cd dist
git init
git add -A
git commit -m "deploy"
git push -f [email protected]:wnortier/wnortier.github.io.git master
cd -

しかし、私はそれを実行するとsh .deploy.sh、それを返します

 DONE  Compiled successfully in 2175ms                                  15:40:48
  File                                 Size               Gzipped

  dist/js/chunk-vendors.c4d3d4de.js    114.27 KiB         40.31 KiB
  dist/js/app.8b5fd9c9.js              6.99 KiB           2.90 KiB
  dist/css/app.35dcd38a.css            0.27 KiB           0.21 KiB

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.
 INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

Initialized empty Git repository in /home/warwick/Projects/wnortier.github.io/dist/.git/
[master (root-commit) 74551eb] deploy
 8 files changed, 14 insertions(+)
 create mode 100644 css/app.35dcd38a.css
 create mode 100644 favicon.ico
 create mode 100644 img/logo.82b9c7a5.png
 create mode 100644 index.html
 create mode 100644 js/app.8b5fd9c9.js
 create mode 100644 js/app.8b5fd9c9.js.map
 create mode 100644 js/chunk-vendors.c4d3d4de.js
 create mode 100644 js/chunk-vendors.c4d3d4de.js.map
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

次のようにgitの設定は以下のとおりです。

[email protected]
user.name=warwick
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/WNortier/wnortier.github.io.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.name=warwick
[email protected]

誰も私を助けることができますか?

ワーウィック:

それは私のSSHキーが正しく、すべてに沿って設定したが判明しました。
私は、次のコマンドを実行して問題を解決するために管理してきました:sudo chown -R $USERNAME /home/<myusername> それは私が[須藤]せずにデプロイスクリプトを実行することができました。

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=15618&siteId=1