1

I'm getting ssh: connect to host xx.xx.xx.xx port 22: Connection refused after updating fstab for mounting Google bucket. fstab entry that I have added is as follows,

bucket mount_point fuse rw,nosuid,nodev,relatime,user_id=1004,group_id=1005,default_permissions 0 0

After connecting through the serial port connection as root I have removed above line from the fstab and restart the vm. Then I'm able to successfully connect to the vm using ssh. I would like to know the connection between fstab and ssh, and also the reason for the above issue.

Hasitha
  • 153
  • 7

3 Answers3

1

The difference between fstab and SSH is that fstab is your operating system’s file system table and SSH (also known as Secure Shell or Secure Socket Shell) is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.

fstab is the primary way that a system mounted files automatically. However, SSH is only used to connect to your VM instances in GCP. You could, however, connect to your VM via serial port if needed.

The correlation between the two is that in order for a VM instance to boot up properly, it needs to find the correct locations of the mounted drives. The fstab table has that information and if its altered incorrectly, you might not be able to bootup and connect to it via SSH.

In conclusion, I would suggest looking at this documentation and follow the tutorial on how to mount Google Cloud Storage Bucket.

If the tutorial does not enable to SSH into your VM instance after alternating the fstab table, let me know so we can further aid the issue.

Anthony Leo
  • 181
  • 4
  • But cloud console web GUI shows that vm is up & running. If vm instance hasn't boot up properly it can't show that message or that information is wrong. – Hasitha Oct 30 '19 at 13:14
  • 1
    Understand that the web GUI will state that your VM is in working order, however, it does not determined by the status of your configuration inside the VM, but by the fact it is able to bootup or not. We have many clients that have running VM instances, but they are unable to connect to them via SSH. This is generally caused by a misconfiguration inside your VM instance. – Anthony Leo Oct 30 '19 at 13:34
0

Would comment, but not an option yet...

@Anthony Leo

The mystery correlation is: a fault in fstab doesn't necessarily stop the VM from booting and mostly running properly, but it does disable ssh, which makes it quite inconvenient to fix the error in fstab.

In my situation, I added a new disk to /etc/fstab, rebooted, and then get "Connection refused" for any ssh attempts, but... the rest of the existing system seems to be working quite well. It responds to pings. The previously configured webserver and wiki respond as normal, I can make new wiki entries and retrieve them... I'm just locked out of ssh, which seems... unnecessary and quite annoying in this circumstance.

Is there a logical reason why fstab faults disable ssh access? Is there a configuration option that might preserve ssh function in the event of a non-critical fstab fault?

0

TL;DR: Every time you mess the FSTAB your VM will not boot.

There is not a direction connection. When you mess up the FSTAB your VM will enter in a faulty state. During the boot process your VM OS (init.d or Systemd) will try to mount the volumes on the FSTAB. If one of the entries is not right, the VM will crash cycling in loop trying to mount something that is not correct.

Armando Cuevas
  • 243
  • 1
  • 15
  • But google cloud console GUI gives notification saying vm has successfully started. So If you are right cloud console will shows wrong information. – Hasitha Oct 30 '19 at 06:23