2014/03/06

Enable password authentication for Google Compute Engine instance.

By default Compute Engine instance uses key pairs to authenticate you into your instance. This is very much recommended for security reasons. When you are first time connecting your instance through gcutil ssh, you will be asked to create a pass phrase for your ssh keys. Gcutil will create key pair in your local machine and copy it over to your project.

However if you want to authenticate ssh from outside world using password, here is a simple step what to do:

Edit file /etc/ssh/sshd_config

Find this line from your sshd_config and change it to PasswordAuthentication yes:
 # Change to no to disable tunnelled clear text passwords  
 PasswordAuthentication no  
Then just reload your OpenBSD Secure Shell server (Debian).
  sudo /etc/init.d/ssh reload  
In a CentOS init.d name is bit different, since it uses OpenSSH server.
 sudo /etc/init.d/sshd reload  
Of course also remember to add firewall rule for TCP port 22. This can be done through Developers Console.


2 comments:

  1. Sorry Meister, Using CentOS6 above method not working...

    ReplyDelete