2015-07-10 188 views
0

我想克隆到我的遠程虛擬機上的存儲庫,它不起作用。 我收到以下錯誤無法克隆遠程虛擬機上的克隆

[[email protected] check]$ git clone -b integratedscript https://github.com/PepperBoy/Project101.git 
Initialized empty Git repository in /home/PepperBoy/myscript/Project101/.git/ 
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/PepperBoy/Project101.git/info/refs 

fatal: HTTP request failed 

在我的個人筆記本電腦,當我嘗試上面,它工作得很好。

我試圖從遠程虛擬機執行ping命令,它工作正常

PING github.com (192.30.252.128) 56(84) bytes of data. 
64 bytes from github.com (192.30.252.128): icmp_seq=1 ttl=54 time=85.8 ms 
64 bytes from github.com (192.30.252.128): icmp_seq=2 ttl=54 time=86.3 ms 
^Z 

我也產生了SSH密鑰並將其添加到我的github

[[email protected] check]$ ssh-keygen 
Generating public/private rsa key pair. 
Enter file in which to save the key (/home/PepprBoy/.ssh/id_rsa): y 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in y. 
Your public key has been saved in y.pub. 
The key fingerprint is: 
08:f5:25:34:ea:42:c3:fb:7a:67:95:17:a7:83:8a:9e [email protected] 
The key's randomart image is: 
+--[ RSA 2048]----+ 
|  ..+ .  | 
| . . o +  | 
| = . .  | 
| . = . . . | 
| o o S o + | 
|  o + + | 
|  .. o . . | 
|  .o.+  | 
| .oEo   | 
+-----------------+ 
[[email protected] check]$ cat ~/.ssh/id_rsa.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA74n/3lzA2kfu3gnPtwXV4tVbL715Jb6wkTa1IY/OT/p+RXxrg9CVtZThVsz3140bNNk2AsBXAkOAHQq31vBoChO8LNefWQyzK85XWEyJvPHJkwhpgPbZdCZ1xAF/1ItprQxPlhVolZ7zKX1QRKGGkqR5a9uzBpwC9gTC/1bpkcbZYNU3ZRUShqIVvMas58i67M03Z8Z7UrGE0PNCLcw0nMFzediGTXaXHVlKyWBSDvmX96cxO1CvBdIZuzBSVEff6vNZ0orbUQ/9mLCJkrkTBMbSaba6NAA8JZhWrQE3GGdZ7SAHPO+shmH2SPNvv4C+19A+ZWE0h+oawSEYt9e0RQ== [email protected] 
[[email protected] check]$ 

請讓我知道我可以git克隆這個回購給我的虛擬主機。 (這實際上是一個私人回購)

+0

ssh密鑰是不必要的;您通過HTTPS訪問存儲庫。你確定你使用正確的用戶名和密碼嗎? –

+0

@MarcusMüllerꕺꕺ,它永遠不會提示我在remove vm上輸入用戶名或密碼。就我個人而言,它確實如此,當我輸入我的憑證時,它可以正常工作。 – PepperBoy

+0

這是回購一個私人的嗎? –

回答

0

您可能正在使用運行環境中的credential-helper,它將爲您緩存密碼。這將不會提供給您的虛擬機。你在哪裏輸入密碼?

或者,您可能已將密碼放在周圍機器的.netrc文件中,但不能在VM中使用該文件。