Error Config_SSH

43 views
Skip to first unread message

Jonas Rafael Rossatto

unread,
Oct 1, 2019, 8:58:51 AM10/1/19
to Google App Engine
Hello! I can't access my ssh server after i change one line on /etc/config/sshd_config. And i din'd find any way to fix this.
Warning: Permanently added 'compute.XXXXXXXXX' (ECDSA) to the list of known hosts.Enter passphrase for key '/home/XXXX/.ssh/google_compute_engine':packet_write_wait: Connection to 34.73.107.42 port 22: Broken pipeERROR: (gcloud.beta.compute.ssh) [/usr/bin/ssh] exited with return code [255].
Screen Shot 2019-10-01 at 5.25.09 AM.png

Nicholas Elkaim

unread,
Oct 4, 2019, 8:19:25 AM10/4/19
to Google App Engine

Hi Jonas,


Have you tried connection via the serial console? You can follow this guide[1] to set up connection and then edit the files as needed. 

You will need a user with a password for this, however.


To add a user, add this startup script to the GCE instance:

1) Go to the VM instances page and click on the Instance name of your VM.

2) Stop the instance and then Click the Edit button at the top of the page.

3) Under Custom metadata, click Add item.

4) Set 'Key' to 'startup-script' and set 'Value' to this script:


#! /bin/bash

useradd -G google-sudoers [username]

echo "[username]:[password]" | chpasswd

 


An alternate way would be to run a startup[2] script that will fix the line that was changed back to how it was, or rename and replace the file back to its original state with the script.


[1] Connecting to serial console: https://cloud.google.com/compute/docs/instances/interacting-with-serial-console#enable_instance_access

[2] Startup scripts: https://cloud.google.com/compute/docs/startupscript


Reply all
Reply to author
Forward
0 new messages