After creating the instance, I can login using gcutil or ssh. I tried copy/paste from the ssh link listed at the bottom of the instance and get the same error message.
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 .
gssapi-keyex is not a way for the client to authenticate to the server; it. replaces the normal key exchange step that uses the server's. ssh_host_{ecdsa,rsa,dsa}_keys. GSSAPIKeyExchange is a way to avoid the. "leap of faith" initial prompt when sshing to a remote host for the first.
Permission denied > (publickey,keyboard-interactive). This should be moved to serverfault. The SOLUTION in my case: Remove spaces around comma separators and everything will work fine.
"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 (. pub) file is in the authorized_keys file.
The permission denied error probably indicates that SSH private key authentication has failed. Assuming that you're using an image derived from the Debian or Centos images recommended by gcutil, it's likely one of the following:
-i
option.There's a script that runs every minute on the standard Compute Engine Centos and Debian images which fetches the 'sshKeys' metadata entry from the metadata server, and creates accounts (with sudoers access) as necessary. This script expects entries of the form "account:\n" in the sshKeys metadata, and can put several entries into authorized_keys for a single account. (or create multiple accounts if desired)
In recent versions of the image, this script sends its output to the serial port via syslog, as well as to the local logs on the machine. You can read the last 1MB of serial port output via gcutil getserialportoutput
, which can be handy when the machine isn't responding via SSH.
gcutil ssh
works:gcutil ssh
does the following:
$HOME/.ssh/google_compute_engine
, and calls ssh-keygen
to create one if not present.sshKeys
for an entry that looks like ${USER}:$(cat $HOME/.ssh/google_compute_engine.pub)
gcutil ssh
invokes ssh
with a few command-line arguments to connect to the VM.sshKeys
, the console and command line tool won't realize that modifying sshKeys
doesn't work, and a lot of the automatic magic above can get broken.ssh
, it may not find your .ssh/google_compute_engine
key. You can fix this by using gcutil ssh
, or by copying your ssh public key (ends in .pub
) and adding to the sshKeys
entry for the project or instance in the console. (You'll also need to put in a username, probably the same as your local-machine account name.)gcutil ssh
, you probably don't have a .ssh/google_compute_engine.pub
file. You can either use ssh-keygen
to create a new SSH public/private keypair and add it to sshKeys
, as above, or use gcutil ssh
to create them and manage sshKeys
.sshKeys
entry doesn't match your local username, you may need to supply the -l
argument to SSH.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With