Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git SSH setup Permission denied (publickey)

I'm using a VWWare image of Ubuntu 8.04 and experiencing problems while setting up git access over SSH

I get the following output

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Offering public key: 
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/jars/.ssh/identity
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/jars/.ssh/identity': 
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

I have generated the keys with ssh-keygen -t rsa

and renamed them to identity (private) and ida_rsa (public), because initially they wheren't found by ssh.

I also created a config file as depicted here...

http://help.github.com/troubleshooting-ssh/

Nothing changed.

Am I missing something or is there generally something wrong with using SSH in VMWare?

Regards

like image 948
Jeremy S. Avatar asked Oct 04 '10 20:10

Jeremy S.


People also ask

How do I fix SSH permission denied Publickey?

This error comes up when using a wrong private key or no key at all when trying to connect via SSH. To resolve the problem, you should generate a new key pair and connect using that new set of keys.

Why do I get permission denied Publickey?

"Permission denied (publickey)" and "Authentication failed, permission denied" errors occur if: You're trying to connect using the wrong user name for your AMI. The file permissions within the operating system are incorrect on the instance. The incorrect SSH public key (.

How do I fix permission denied Publickey password?

Solution 1: Enable Password Authentication If you want to use a password to access the SSH server, a solution for fixing the Permission denied error is to enable password login in the sshd_config file. In the file, find the PasswordAuthentication line and make sure it ends with yes .


1 Answers

Check your permissions on your .ssh directory on the local and remote sides:

drwx------ 3 xxx xxx 216 10-04 12:30 .ssh/
-rw------- 1 xxx xxx  745 06-19 12:37 authorized_keys
-rw------- 1 xxx xxx  783 05-08 22:15 config
-rw------- 1 xxx xxx 3.3K 2009-02-21  id_rsa
-rw------- 1 xxx xxx  745 2009-03-06  id_rsa.pub
-rw-r--r-- 1 xxx xxx  53K 09-27 15:51 known_hosts

If that doesn't work, run the SSH server from the command line in debug mode. It may give you more information why it is rejecting the login.

sudo /usr/sbin/sshd -Dd
like image 119
cmcginty Avatar answered Sep 20 '22 01:09

cmcginty