跳到主要內容

Permission Issues on Linux

Usually, it's recommended to run blocklet server as a non-root user for security reasons, and you should always use the same user that created the server to start/stop the server because those who created the server are granted permission to read/write to the blocklet server directory.

You may encounter issues when switching back and forth between different users when init/start/stop your blocklet server, use the following steps:

javascript
ubuntu@fnm:~$ sudo blocklet server init -y

// the server is initialized by root
ubuntu@fnm:~$ blocklet server start

// then non-root user try to update data in server directory during start

If we flip the above steps:

javascript
ubuntu@fnm:~$ blocklet server init -y

// the server is initialized by non-root
ubuntu@fnm:~$ sudo blocklet server start

// then root user try to update data in server directory during start

You may encounter permission issues in all the above scenarios because the server creator is not the same as blocklet server starter.

So, to keep things clean and tidy, just stick to the same user that created the server to do any furthur operations.