Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Server: CentOS 5.7

Local machine: Macbook Pro, regular terminal client

Command issued:

git clone --bare ssh://myuser@xxx.xxx.xxx.xxx/home/projectname/public_html ~/gitrepos/projectname.git

Result: stdin: is not a tty fatal: '/home/projectname/public_html' does not appear to be a git repository fatal: The remote end hung up unexpectedly


I have a Linode that several sites share. I have my own site under myuser, and I know that I should be getting round to disabling ssh access for root for security, and doing everything by Sudo. I've added myuser to the /etc/sudoers file, with the same permission level as root. I want myuser to have global access to do anything on the site server, as it's the account I'll be using for everything going forward.

projectname is another user with, as far as I can tell, the same permissions as myuser. These are created using WebHostManager to make a CPanel instance.

I want to be using myuser to use Git SCM as I have turned off shell access for the projectname user (plus I'm lazy - I just want one account no matter what site I'm working on).

If I cd /home/projectname I can sudo ls OK, but I can't then sudo cd to move into the directory. My gut says this is the underlying reason the Git Clone is failing, because I don't have the permissions to see inside the projectname account. There's definitely a working Git repo in public_html (I can see .git when I ls as root), so I don't really believe the error that's coming back.

Thanks in advance for your help.

share|improve this question
have you tried appending a .git to the end of the 'public_html' ? –  qweet Feb 23 '12 at 13:20
Just tried with projectname/public_html/.git, and no luck. That repo does exist. –  Ben Feb 23 '12 at 13:23
I noted you don't have root disabled yet, so give root a try at cloning that repo. If that doesn't work then it's a path problem, if it does work then it's a permissions problem –  qweet Feb 23 '12 at 13:35
Thanks - great idea (aka kicking myself!). It works fine as root. Am I best to correct the permissions by adding myuser to a group with appropriate permissions, or change the perms for the myuser account itself - and how? –  Ben Feb 23 '12 at 14:14
There are many ways, the simplest one which will take a few seconds is 'chown user.group -R /home/projectname ; chown user.group -R /home/projectname/.git', which will make you the owner of the folder and the git. It's simple enough for what you want at the moment (also, get to disabling root ssh access. It's not kosher ;) ) –  qweet Feb 23 '12 at 14:21
show 2 more comments

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.