I have a problem with my Google Compute Engine VMs.
After creating the VM, the SSH connection and the FileZilla connection are good at the beginning.
However, over time, the screen to connect to SSH loops, and FileZilla throws this error and the connection fails:
Status: Server refused our key
Error: FATAL ERROR: No supported authentication methods available (server sent: publickey)
(I connect to the server using SFTP, and generate a key file using puttygen.)
These are what I have tried.
-
Delete and re-create the instance
-
Create another project and create new instance there
-
Replace the key file with a new one
I didn’t wrote wrong server address or adding wrong keyfile ; everything should work properly.
and in the firewall settings, all port forwarding is configured normally.
Why is this happening?
(The VM is with debian-10-buster-v20200618 / using it for game server
I have contacted Google with chat support once, but it’s not supporting anymore.
because I’m using a free trial.
Although I used enable-oslogin
value at the VM and SSH succeeds to connect, FileZilla is still not working.)
What I did and tested :
Firstly I created an instance fir the game server purpose. And when I create an istance and connected to SSH, I use sudo su and created a directory at /home. just make it easier to look at.
I install screen, java, locale and other stuffs.
but Suddenly filezilla and ssh connection stops working after a few minutes without notifying me.
I didn’t do anything without these stuffs.
I reinstalled filezilla, also created a new key from puttygen and set the keyfile both filezilla and vm ; not working.
I even created a new project and created the instance ; same thing happens.
I clean up the metadata and SSH key. It’s Not working.
I even contacted with google and doing conversation via email.
But since I don’t have much time left the credits spend alone. So I wrote a article right here.
==============================================================================
And I’m like I said I’m using SFTP Protocol to connect my VM to transfer game server files.
If you’re asking about SSH connection, I’m using default SSH button at the VM Instance list nothing special that I can tell more about…
2
Answers
Problem solved.
It was my fault configuring date and time + locales.
Changed to Linux Debian 9 stretch and used dpkg-reconfigure to configure it. Works without problem.
(I used cp -p /usr/share/zoneinfo/Asia/Seoul /etc/localtime to change timezone. (I live in Korea) and changed locale settings by editing /etc/default/locale.)
How I changed it
Original :
My Version :
after these settings, I get problems what I explained before. (check the article above.)
But I downgraded to Debian 9 (strech) (for some reason with jdk) and used
dpkg-reconfigure tzdata
anddpkg-reconfigure locales
to change these settings.After that I have no problems with the timezone and locales.
(Thank you W_B trying to help me.)
I reproduced your case – created a new VM (debian 10) with
oslogin
enabled.Then I logged in from the browser, created
.ssh
directory in my home dir (mkdir .ssh
). Then created anauthorized_keys
file inside and pasted my public key from my personal computer (it’s a Mac and doesn’t havegcloud
installed;touch authorized_keys
) and pasted my public key in this file (id_rsa.pub
) withnano authorized_keys
. Then saved (ctrl + o
) and exited (ctrl + x
).My ssh key (on my personal computer) was created simply by using "ssh-keygen` command without any parameters.
To check if the key is in place and working try to ssh from another instance (
ssh [email protected]
) and yoo should get a shell prompt.After that I was able to create a new connection in the FileZilla (SFTP protocol, and chose
login type' to
key file’ and selected my private key (stored in.ssh/id_rsa
) file.My connection is active for more than 2 hours and I can disconnect and connect again & transfer files both ways.
Please follow my directions and this should work. From what you’ve described your FileZilla config is the case here.
Also – if for some reason you still can’t connect create a firewall rule to allow traffic on port 22.