New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy and run as different user. #2232
Comments
We removed |
I did eventually find the issues that talked about that. I did come up with my own method, but I need #2231 to be fixed. Do you have any thoughts on that? |
You can just execute PM2 with |
Has the |
@gkalpak No you need to start the |
OK, thx for the quick reply. Should the |
The --user option is only used by the |
Sorry. You are right! |
Is there any plan to reinstate the |
@jmeit I was playing around with this because I needed a specific user to execute a process. They don't have the |
Following @architech99's suggestion worked for Giving up on using |
I have figured out how to run PM2 as another user, but it's not so simple. Basically I just created another user, su into that user, and run PM2 from there. I'm trying to accomplish what nginx and apache do when they run as root, but fork the processes as www-data. I don't see a way to change the user after forking.
I can do this automatically with a startup script. Since init.d is run with root privileges, it can easily change the user.
My problem comes when I also want to use deploy from the local machine. Deploy requires that the same user which ssh's is the one who runs PM2. I (like most) do not allow SSH from root. I was able to to configure my machine to allow my user to su into my "www-data" using /etc/PAM.d/su, but I have hit a road block with the way deploy was written: #2231.
Has another accomplished deploy and a startup script?
Should the related issue be fixed and my workarounds be how it's done?
Can I request that PM2 forks as another user with lower permissions?
The text was updated successfully, but these errors were encountered: