I am trying to open Sagemath through Jupyter. I am getting the following message in Firefox:
Access to the file was denied
The file at /home/tw/.local/share/jupyter/runtime/nbserver-61611-open.html is not readable.
It may have been removed, moved, or file permissions may be preventing access.
Recently, I migrated to Ubuntu 22.04 (from 20.04). Under Ubuntu 20.04, Juypter worked finely. Also the file permissions are fine and all set to "rw" for all users. I have read somewhere that Firefox does not open hidden files anymore. I tried to change advanced settings in Firefox, without success. I could not even find the relevant advanced setting option. I cannot open the above html-file from chrome either. Reinstalling Sagemath was also not helpful.
In 22.04, Ubuntu ships Firefox as a snap. The snap version of Firefox has strict file permissions for the sake of security, but often it compromises the user friendliness. The solution is to replace the snap version of firefox with the apt version.
Add the Firefox PPA maintained by Mozilla team
Copy and paste the following code in a terminal (don't copy-paste line by line) to prioritize the apt version of firefox with the snap version.
Remove the snap version of firefox
Install Firefox with apt.
This version of Firefox should update when you update the system with the update manager (but it does not automatically upgrade in the background like the snap version).
Source: OMG Ubuntu
Instead of messing with Firefox, you can access SageMath through http://localhost:8888 instead.