To achieve this, you must change the entire system files and directories to read-only, which is very bad and dangerous:
chmod -R 0744 /
At the same time, modify the permissions of the directory (directory:/home/user 1) of the logged-in user (for example: user1) to:
chmod -R 0444 /home/user 1
In this case, the user 1 will only have read-only access to the system, but logging in the user will face a lot of warnings/error prompts.