0

I have deployed my nodejs app in Google Cloud Platform Compute Engine (instance-1), while logged in as user user1. I installed all the required modules and I ran pm2 on the instance. My site is working fine.

I have another user who has access to that instance. When the other user tried to restart the pm2 process he is not able to access the pm2 process running on user1's user space. How to resolve this problem so that both the users can modify the process and resources running on the instance?

roschach
  • 8,390
  • 14
  • 74
  • 124
GRS
  • 1,829
  • 1
  • 9
  • 23

1 Answers1

1

Does the other user have the proper IAM permission on the VM instance? I believe they will need either the Instance Admin (v1) or Compute Admin role. Check here for more info about IAM roles and permissions.

alp
  • 642
  • 5
  • 13
  • Have given Compute Instance Admin Permission to user 2. But still user2 is not able to perform "pm2 list". pm2 process was run from user1 space. when user 2 tried pm2 list its showing empty – GRS Jan 09 '19 at 06:44
  • can you tell more about the "user space" and pm2 list process? How are the users in different spaces and what does the process execute? How can I reproduce this scenario? – alp Jan 09 '19 at 07:53
  • ssh as user1 to the instance. install pm2 run node server through pm2 as pm2 start nodeapp. then ssh into the isntance as user2. pm2 list is not showing up the nodeapp. – GRS Jan 09 '19 at 08:16
  • found this, your question seems to be a duplicate: https://stackoverflow.com/questions/32178443/how-to-run-pm2-so-other-server-users-are-able-to-access-the-process – alp Jan 09 '19 at 08:20
  • Thank yo for ur help. Got it – GRS Jan 09 '19 at 09:03