Score:0

How Restrict User in his home directory while using npm, pm2 and forever commands

mo flag

I want to restrict users within their home directories from the terminal and FileZilla as well. The user can run npm, pm2, and forever commands to deploy their projects. I have tried chroot jail but using chroot jail user was unable to run the commands mentioned above. I also tried rbash but the user was not able to run forever and npm commands also user can access all directories from Filezilla.

Is there any solution to restrict users while using these commands?

in flag
Short answer: no. While you *can* do it, it will require a very strong knowledge of the inner workings of `npm` and its myriad of running options. It means building a house of cards that will make the server configuration "too complicated to replace". This will essentially create a legacy server that can never be replaced, only bandaged as time goes on. The cleanest solution will be to make use of Docker containers, with one container being spun up per user and having that user's upload location be a mounted location inside the container.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.