title: ssh to remote pc in the same network - Permission denied (publickey)
body: <p>I am trying to install git on a remote server and these are the details of that pc</p>
  
  <pre><code>IP 192.168.1.7 
  Ubuntu version 12.04 32 bit 
  </code></pre>
  
  <p>and I have install both openssh and the status of the ssh is this </p>
  
  <pre><code>ssh start/running, process 756
  </code></pre>
  
  <p>And I am trying to ssh to that pc from local pc and these are the details of my local</p>
  
  <pre><code>IP 192.168.1.4
  Ubuntu version 12.04 64 bit
  </code></pre>
  
  <p>I have ping to the 192.168.1.7 </p>
  
  <pre><code>rashendra@rashendra:~$ ping 192.168.1.7
  PING 192.168.1.7 (192.168.1.7) 56(84) bytes of data.
  64 bytes from 192.168.1.7: icmp_req=1 ttl=64 time=0.918 ms
  64 bytes from 192.168.1.7: icmp_req=2 ttl=64 time=1.02 ms
  64 bytes from 192.168.1.7: icmp_req=3 ttl=64 time=3.78 ms
  ^C
  --- 192.168.1.7 ping statistics ---
  3 packets transmitted, 3 received, 0% packet loss, time 2000ms
  rtt min/avg/max/mdev = 0.918/1.908/3.782/1.326 ms
  </code></pre>
  
  <p>which means I can connect to that pc , and the connectivity is alive.</p>
  
  <p>I have generate the rsa public/private key which are stored in <code>the /home/rashendra/.ssh</code> </p>
  
  <pre><code>rashendra@rashendra:~/.ssh$ ll
  
  total 20
  drwxrwxrwx  2 rashendra rashendra 4096 Nov 17 11:37 ./
  drwxr-xr-x 47 rashendra rashendra 4096 Nov 17 08:35 ../
  -rw-------  1 rashendra rashendra 1679 Nov 17 10:57 id_rsa
  -rwxrwxrwx  1 rashendra rashendra  401 Nov 17 10:57 id_rsa.pub*
  -rw-r--r--  1 rashendra rashendra  444 Nov 17 11:45 known_hosts
  </code></pre>
  
  <p>After that I copied the content of the <code>id_rsa.pub</code> to the <code>authorized_keys</code> in the <code>.ssh</code> of the remote pc</p>
  
  <pre><code>cat /tmp/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
  </code></pre>
  
  <p>This is the <code>.ssh</code> of the git user which I created.<br>
  So, now I am trying to connect to the remote pc using </p>
  
  <pre><code>ssh git@192.168.1.7 
  </code></pre>
  
  <p>yet gives the following error:</p>
  
  <pre><code>rashendra@rashendra:~/.ssh$ ssh git@192.168.1.7
  
  Permission denied (publickey).
  </code></pre>
  
  <p>Please advice how to resolve.
  As I need to install git on this remote server and maintain further.</p>