2013-01-03 20 views
7

Quando eseguo git pull origin test, ottengoIl permesso Git pull ha negato linux?

fatal: unable to connect to cache daemon: Permission denied 

seguito dalla richiesta di nome utente e password GitHub. La directory si trova sotto la mia cartella personale (~/www/software). Qualche idea? Se uso sudo, funziona, ma non mi sento come dovrei dover usare su all'interno della mia cartella home!

Qui è il risultato di ls -l:

drwxrwxrwx 48 root root  53248 Jan 3 12:10 application 
-rw-rw-r-- 1 andrewr andrewr 1458793 Jan 2 10:09 a.txt 
-rw-rw-r-- 1 andrewr andrewr  186 Jan 2 10:09 Desktop.ini 
-rw-rw-r-- 1 andrewr andrewr 1406 Jan 2 10:10 favicon.ico 
-rw-rw-r-- 1 andrewr andrewr 6858 Jan 2 10:10 fb.jpg 
-rw-rw-r-- 1 andrewr andrewr  2 Jan 2 10:10 format 
-rw-rw-r-- 1 andrewr andrewr  398 Jan 2 10:10 index.php 
-rw-rw-r-- 1 andrewr andrewr 16572 Jan 2 10:10 license.txt 
-rw-rw-r-- 1 andrewr andrewr 1390 Jan 2 10:10 loginscreen.php 
-rw-rw-r-- 1 andrewr andrewr 6424 Jan 2 10:10 md5_login.js 
-rw-rw-r-- 1 andrewr andrewr  65 Jan 2 10:10 phpinfo.php 
-rw-rw-r-- 1 andrewr andrewr 9202 Jan 2 10:10 readme.html 
-rw-rw-r-- 1 andrewr andrewr  101 Jan 2 10:09 README.md 
-rw-rw-r-- 1 andrewr andrewr  229 Jan 2 10:09 README.txt 
-rw-rw-r-- 1 andrewr andrewr 180467 Jan 2 10:10 svn.ico 
-rw-rw-r-- 1 andrewr andrewr  71 Jan 2 10:10 test.php 
-rw-rw-r-- 1 andrewr andrewr 46080 Jan 2 10:09 Thumbs.db 
-rw-rw-r-- 1 andrewr andrewr 4268 Jan 2 10:10 wp-activate.php 
drwxrwxrwx 9 root root  4096 Jan 2 10:10 wp-admin 
-rw-rw-r-- 1 andrewr andrewr 40272 Jan 2 10:10 wp-app.php 
-rw-rw-r-- 1 andrewr andrewr  274 Jan 2 10:10 wp-blog-header.php 
-rw-rw-r-- 1 andrewr andrewr 3982 Jan 2 10:10 wp-comments-post.php 
-rw-rw-r-- 1 andrewr andrewr 3444 Jan 2 10:10 wp-config.php 
-rw-rw-r-- 1 andrewr andrewr 3087 Jan 2 10:10 wp-config-sample.php 
drwxrwxrwx 6 root root  4096 Jan 2 10:10 wp-content 
-rw-rw-r-- 1 andrewr andrewr 2684 Jan 2 10:10 wp-cron.php 
drwxrwxrwx 8 root root  4096 Jan 2 10:10 wp-includes 
-rw-rw-r-- 1 andrewr andrewr 1997 Jan 2 10:10 wp-links-opml.php 
-rw-rw-r-- 1 andrewr andrewr 2546 Jan 2 10:10 wp-load.php 
-rw-rw-r-- 1 andrewr andrewr 27695 Jan 2 10:10 wp-login.php 
-rw-rw-r-- 1 andrewr andrewr 7777 Jan 2 10:10 wp-mail.php 
-rw-rw-r-- 1 andrewr andrewr  413 Jan 2 10:10 wp-pass.php 
-rw-rw-r-- 1 andrewr andrewr  334 Jan 2 10:10 wp-register.php 
-rw-rw-r-- 1 andrewr andrewr 9913 Jan 2 10:10 wp-settings.php 
-rw-rw-r-- 1 andrewr andrewr 18545 Jan 2 10:10 wp-signup.php 
-rw-rw-r-- 1 andrewr andrewr 3702 Jan 2 10:10 wp-trackback.php 
-rw-rw-r-- 1 andrewr andrewr 1834 Jan 2 10:10 x.htaccess.bak 
-rw-rw-r-- 1 andrewr andrewr 3266 Jan 2 10:10 xmlrpc.php 

Quasi tutte le modifiche vengono apportate all'interno della cartella di application

+0

inviare il risultato di 'ls -l ~/www/software' –

+0

fatto .. grazie per l'aiuto –

risposta

17

Il problema è che git è in grado di connettersi alla propria cache delle credenziali (Leggi http://git-scm.com/docs/git-credential-cache per maggiori informazioni).

Da documentazione:

La cache è accessibile su un socket di dominio Unix, ristretto per l'utente corrente dalle autorizzazioni del file system.

Quindi tutto ciò che serve è controllare un permesso di file per questo socket di dominio. Di solito viene inserito in ~/.git-credential-cache/socket e modificato per renderlo accessibile all'utente andrewr.

4

Il problema sembra essere proprio all'interno il proprietario dei file. Date un'occhiata:

drwxrwxrwx 48 root root 53248 Jan 3 12:10 application 
... 
drwxrwxrwx 9 root root 4096 Jan 2 10:10 wp-admin 

Anche se queste directory sono leggibili, scrivibili ed eseguibile da tutti, i file all'interno può non essere. Inoltre, avere le directory di proprietà di root nella tua cartella Inizio probabilmente non è una buona idea.

Questo comando dovrebbe risolvere il problema, se eseguito entro ~/www/software:

chown -R andrewr:andrewr * 
+0

ancora ottenere l'errore ... ma ora mostra il mio nome utente su ogni riga ... –

+0

' sudo chown - R ubuntu: ubuntu ~/.git-credential-cache/'ha fatto il trucco. – Yerk

Problemi correlati