1

I have been through most of Questions surrounding this issue on this site however nothing seems to have helped me. Basically what I am trying to do is instantiate a Hadoop instance on my VM via the bdutil script supplied by Google , however the problem seems to be related to the fact that I cannot ssh into the VM instance.

I have been struggling with this for a couple of days now so I really appreciate your help.

Here are the steps I followed:

In order to walk you thru the steps I have just created a new VM

I am able to SSH in thru the developer’s console with no problem

The following shows the system info and operating system:

uname –a Linux archipelago-vm1 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014

tail /etc/redhat-release tail: inotify cannot be used, reverting to pollingCentOS release 6.5 (Final)

The VM has been set up to allow both http and https connections

On my windows machine (window 8.1 professional) I removed all previously created SSH files, to allow the creation of new ones I also removed all previously created keys on the project (there was a lot of junk out there as I have been trying several things to get this to work)

I then authorized to the new VM using gcloud Auth Login

This works fine and I get authorized and logged in

I can see the instance using gcloud compute instances list

Then I try to SSH into the instance

It says that it is generating my SSH keys and it does, on both my machine and the VM instance

However it cannot SSH into the machine Note: I have tried this with both a pass phrase and without a pass phrase, in this instance I left it blank

the error I am receiving is No supported authentication methods available

When I check the files they have been created in both places on my machine as well as on the project in the metadata / ssh keys section

When I compare the .pub file on my machine and the key on the vm these 2 keys they are identical I also tried adding the keys to the SSH keys specific to the vm instance with no luck

The interesting thing here is when I use the putty on my Machine I can login with no problem, using the C:\Users\cleveen.ssh\google_compute_engine.ppk file

So initially I thought , No problem I will just use my putty , however when I tried to run the bdutil script to instantiate Hadoop it gave me error that I was not logged in via gcutil and would not run the script , so I then logged in via the developers console and it still would not run (same error)

I then went into the sshd_config file and allowed password logon, set a password for my account and then gcloud SSH, allowed me to login via the password with no problem.

However when I ran the script it created all the instances and drives it needed for Hadoop, however the script failed on SSH public key errors and I could never get it to complete.

Unfortunately I do not have the log files from this script as I deleted the instance that they were on; I can go thru these steps again if it would be helpful for you to see these logs.

However this all seems to be related to the fact that the SSH process using key files does not work

Please let me know if I can provide any additional info Thanks again for your help with this

Dennis Huo
  • 10,517
  • 27
  • 43
cleveen
  • 11
  • 1

3 Answers3

1

So, it sounds like there are a couple issues at work here:

  1. bdutil still uses gcutil ssh instead of gcloud compute ssh (but work is in-progress to upgrade to using gcloud compute ssh), so even if you can configure your local environment to make gcloud compute ssh work, bdutil still requires gcutil ssh to work in order to deploy Hadoop clusters - note that in most circumstances, these two different commands function the same.

  2. Running from cmd.exe or Putty doesn't sufficiently set up the environment for "gcutil"; traditionally, the instructions included installing "cygwin" to provide a posix environment in which to run the Google Cloud SDK tools.

You can see this related stackoverflow post regarding needing cygwin for "gcutil ssh": Unable to run gcutil from command line

So, if you make sure cygwin is installed, and then using the cygwin shell (not cmd.exe or Putty), you ensure "gcutil ssh " works with no passphrase, then bdutil should work from cygwin from then onwards.

One alternative is to start a single n1-standard-1 VM running something like debian-7 as your "bdutil runner", making sure to click on "Advanced Settings" and enabling both the Cloud Storage and the Compute Engine "service accounts". Inside that "bdutil runner", you can configure its own ability to "gcutil ssh" by typing

gcutil ssh `hostname`

and keeping the passphrase empty when it prompts you, and then use that VM to run your deployments.

Community
  • 1
  • 1
Dennis Huo
  • 10,517
  • 27
  • 43
1

You can ssh from a Windows machine to a GCE instance in the following way:

  1. remove all previous python versions, delete the folder ".ssh" under Users\yourusername and delete the previous Program Files\Google directory
  2. install the newest Windows version of the Cloud SDK and accept to install python 2.7. https://cloud.google.com/compute/docs/gcloud-compute/#install
  3. open the Google Cloud SDK shell as administrator and execute $ gcloud auth login
  4. gcloud compute ssh to the VM of your choice (note: this will fail, but will create the Google Cloud ssh keys on your windows machine)
  5. open the putty version which came with Cloud SDK in Program Files\Google\Cloud SDK\google-cloud-sdk\bin\sdk\ssh-term
  6. specify your key in Putty: chose Connection, SSH, Auth, click "Browse" , select the key from Users\yourusername.ssh
  7. In Putty, click on "Session" insert the IP of your VM and connect (use your Windows user name for the "login as") You can find this user name at the end of your public key.
Thomas
  • 101
  • 3
0

1) check the .ssh directory permission, try sudo chmod -R 700 .ssh on you directory may be it will help you if causing the issue

agarwal_achhnera
  • 2,582
  • 9
  • 55
  • 84