0

I'm running a tinycore machine that I store my code on before pushing it to github. This is also the only machine that has port 22 forwarded at home so I have to do the push from this machine due to github using ssh as it's protocol for doing pushes and pulls. I was trying to do a push today and I've been getting permission denied (Publickey) errors, So I than read this page So I created a ssh config file at ~tc/.ssh/config with the following content:

Host github.com
    User git
    Hostname github.com
    PreferredAuthentications publickey
    IdentityFile /home/tc/.ssh/id_dsa.pub

And did am still having issues after attempting to re-generate my dsa key pair.

Basically, what I am seeing is that after I regenerate my dsa key pair after running

ssh-keygen -t dsa

I then confirm the overwrite, hit enter three times to use: default location /home/tc/.ssh/id_dsa (and id_dsa.pub in the same directory), and no passphrase. I than attempt to ssh to github to test the connection using ssh git@github.comand get the error:

Permission denied (publickey).

So I figured this was due to me not adding my newly generated public key to github. So, I cat the public key and copy the output into my settings on github, now every time I attempt to ssh to github It's asking me for a passphrase, even though I never specified one and it didn't ask me prior to viewing the file. Also, the permissions seem to be fine at rw only for user tc.

1 Answers1

5
IdentityFile /home/tc/.ssh/id_dsa.pub

That should point to your private key, not your public key. The public key resides on the server you're connecting to.

EEAA
  • 108,414
  • 18
  • 172
  • 242