Running program as another user from the command line not working
by peter7089 from LinuxQuestions.org on (#530M3)
I am using Xubuntu and i am trying to run programs as another user from the command line, but it's not working. I have two users - user1 and user2. I am logged in as user1 and if i switch to user2 with the command `su user2` and try to launch a program, for example `mousepad` i get this:
Code:No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:The same happens with other programs if i try to launch them as `user2`, just with different error messages.
Why is this happening? Is it possible to run programs as `user2` from the command line?


Code:No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:The same happens with other programs if i try to launch them as `user2`, just with different error messages.
Why is this happening? Is it possible to run programs as `user2` from the command line?