Disabling shared memory prevents ssh login

I’m setting up a new Linode server and following steps from here: https://help.ubuntu.com/community/StricterDefaults

2 times now if I follow the following steps:

Edit /etc/fstab
Add this line: 
    tmpfs     /dev/shm     tmpfs     defaults,ro     0     0
Reboot

After reboot I’m no longer able to ssh into the server.

In /etc/fstab, its indicated in the format comment that the file path should be the first option. “tmpfs” is before that. Could this be a typo in the documentation?

Answer

First, the syntax as given is correct. The line in /etc/fstab is supposed to begin with tmpfs. Note that the way you posted it, it begins with spaces, which should not be there.

Second, the page you linked to did warn you:

Note: MANY programs will not work if you make /dev/shm read-only (e.g. Google Chrome).

If you’re trying to secure /dev/shm then that’s going too far. Try just noexec,nosuid instead.

Attribution
Source : Link , Question Author : Geuis , Answer Author : Michael Hampton

Leave a Comment