<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: makhosii</title>
    <description>The latest articles on DEV Community by makhosii (@makhosii).</description>
    <link>https://dev.to/makhosii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F330436%2F9913c3e4-d203-4c9d-b6b2-ea2be51362e8.png</url>
      <title>DEV Community: makhosii</title>
      <link>https://dev.to/makhosii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/makhosii"/>
    <language>en</language>
    <item>
      <title>SSH Authentication issues: Permission denied(publickey)</title>
      <dc:creator>makhosii</dc:creator>
      <pubDate>Sun, 27 Jun 2021 11:32:04 +0000</pubDate>
      <link>https://dev.to/makhosii/ssh-authentication-issues-permission-denied-publickey-4enj</link>
      <guid>https://dev.to/makhosii/ssh-authentication-issues-permission-denied-publickey-4enj</guid>
      <description>&lt;h2&gt;
  
  
  Assumptions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The author assumes that that you are trying to ssh into a server or (git server) using a public key instead of a passphrase.&lt;/li&gt;
&lt;li&gt;You have generated a ssh key on your local machine.&lt;/li&gt;
&lt;li&gt;You have transferred the ssh key to the server, and your OpenSSH server is configured.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Method 1
&lt;/h2&gt;

&lt;p&gt;If your key is not saved in &lt;code&gt;.ssh/id-rsa&lt;/code&gt; or if you have more than one ssh key on your local machine. Then have to mention the location of your key using the i flag &lt;code&gt;(-i)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh user@192.168.1.101 -i ./.ssh/id_rsa_supremee_key&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Method 2
&lt;/h2&gt;

&lt;p&gt;Or better yet, you can configure the OpenSSH client.&lt;/p&gt;

&lt;p&gt;On windows the config file is found at &lt;code&gt;C:\Users\username\.ssh\config&lt;/code&gt;. So head to this file and add the key\values below, (obviously yours will be different)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
#Personal account, - the default config
Host makhosi6.github.com
   HostName github.com
   User git
   IdentityFile ~/.ssh/id_rsa

#work account 
Host dev.github.com  
   HostName github.com
   User git
   IdentityFile ~/.ssh/id_rsa_dev

#supremee
Host 192.168.1.102
   HostName 192.168.1.102
   IdentityFile ~/.ssh/id_supremee_key

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.digitalocean.com/community/questions/how-to-ssh-with-i-flag"&gt;www.digitalocean.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/"&gt;nerderati.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ssh.com/academy/ssh/config"&gt;ssh.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linuxize.com/post/using-the-ssh-config-file/"&gt;linuxize.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://thereference.dev/article/ssh-authentication-issues-permission-denied"&gt;thereference.dev&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
