git - Proper permissions for /var/www -
i'm attempting clone private repo bitbucket /var/www on centos vps.
i've generated ssh key pair on vps, , uploaded .pub file bitbucket (read-only) deploy key.
the keys setup properly, because when connect using:
ssh -t git@bitbucket.org
it works fine:
authenticated via deploy key. can utilize git or hg connect bitbucket. shell access disabled. deploy key has read access next repositories: <username>/<repo_name>: <deployment key nickname> -- <vps_username>@<vps_hostname> connection bitbucket.org closed.
so far, good. when seek clone repo /var/www,i get:
fatal: not create work tree dir '<repo_name>'.: permission denied
when sudo it, get
permission denied (publickey).
i found note in bitbucket docs regarding said error:
you used sudo when attempting connection not need utilize sudo when cloning repository or other ssh action bitbucket.
it looks need run root permissions create tree, if do, isn't using ssh key correctly.
so, chmod'd /var/www directory non-root user have write privileges, , worked fine. directory 777 (drwxrwxrwx), isn't good.
is there improve way handle this? i'd /var/www 755, don't want mess around temporary chmod every time want update code...
thanks in advance!
make /var/www group-writable (chmod g+w /var/www
) , alter grouping group trusted users (including you) fellow member of. if don't want open of /var/www perhaps can introduce level, /var/www/foo, open up.
git bitbucket file-permissions centos6.5
No comments:
Post a Comment