[CentOS] google cloud compute with PEM file

Tue May 17 16:47:26 UTC 2016
Tony Mountifield <tony at softins.co.uk>

In article <573B48C8.1070000 at consistentstate.com>,
Dustin Kempter <dustink at consistentstate.com> wrote:
> Hi all,
>      I am using the google cloud compute engine and we have a client 
> that does not want to share their ssh keys. So I have been attempting to 
> set up a PEM file for ssh access. Both the local server I used for 
> testing and the cloud vm are centos 6.
> 
> I created a user on the cloud box, ran "ssh-keygen -t rsa" and took the 
> defaults. I then copied the id_rsa.pub file to the local centos box, 
> renamed it then made my test user the owner of the file. I then 
> attempted to connect to the user I created on the google cloud box with 
> the PEM file as shown below, but got the following error.
> 
> [test1 at pgpool1 ~]$ ssh -i /home/test1/my-key.txt upload at 815.677.151.45
> Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
> 
> Have any of you done this successfully before? Or know what the issue 
> may be?

Try adding -v to the ssh command, to get more information.

But also, on the server you are trying to log in to, the public key
needs to be copied into ~/.ssh/authorized_keys - not left in its own file.

Also make sure that the ~/.ssh/directory is owned by the user and has
permissions of 700.

Cheers
Tony

-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org