Answer the question
In order to leave comments, you need to log in
How to use chroot correctly?
The task is this, there are several games on node.js and several users.
Please tell me how to do it right so that each user has his own copy of the node, so that each user runs his own game?
As I understand from the docks, you need to execute the chroot command for the user directory (for example , home/checkers ), then install a node for each user?
Answer the question
In order to leave comments, you need to log in
If you just run several daemon instances from different users, then chroot is not needed here. The node works fine from different users (on different ports, of course). I wrote
about how to make a chroot here - https://debian.pro/440 .
If paranoia gnaws, then here - https://debian.pro/1237
But you didn't write how you are going to run it at all.
You can read something like this - https://www.exratione.com/2011/07/running-a-nodejs...
But there either write an init script for each instance (users, change paths), or rewrite it so that it depending on the name of the user who launched the script, went to the correct directory.
In its simplest form, Node.JS (in one thread, emnip) is launched like this:
npm app
or
node / nodejs something there.
Accordingly, if the command is npm app, then you can run it from the console (before the first reboot) like this:
disown npm app; echo $!
And then do a kill on the number to stop.
This is all relevant if you will allow users via ssh.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question