title: aws ec2 install git server
body: <p>I tried to set up git server
  AWS-EC2 AMI ubuntu-16.04
  login-as:ubuntu</p>
  
  <pre><code>ubuntu@~$su
  root@~#apt install git-core
  root@~#adduser git
  root@~#cd /
  root@/#mkdir git
  root@/#chmod 777 git
  root@/#cd git 
  root@/git#mkdir .ssh
  root@/git#git init --bare test.git
  root@/git#chown -R git:git test.git
  </code></pre>
  
  <p>client : windows7 git</p>
  
  <pre><code>$ssh-keygen
  $cat ~/.ssh/id_rsa.pub | ssh  ubuntu@public ip "cat &gt;&gt; /home/ubuntu/.ssh/authorized_keys"
  </code></pre>
  
  <p>server ubuntu-16.04
  root@/#cp /home/ubuntu/.ssh/authorized_keys /git/.ssh/authorized_keys</p>
  
  <p>client: windows7 git</p>
  
  <pre><code>$git clone git@public ip:/git/test.git
  git@public ip: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>WHY?
  I'm at VMware workstations ubuntu-16.04 was a success
  Give me a hand, please. Thank you</p>