maybe i am an   idiot   but in this command you become the stack user  and in the next you are root  seems to be a disconnect here  why are you switching to the stack user if the next thing you do is as root  or is stack root 