Create a new user for vncserver

Install vnc:

apt-get install tightvncserver xtightvncviewer

Create a new user:

useradd -c "Tightvnc user" -m -r -s /bin/bash vncuser
sudo -iu vncuser bash
unset XAUTHORITY
vncserver

Create the password and you are done.

Reference:

Note that 5901 is the default port.

Now, everytime you do:

sudo -iu vncuser bash

,
vnc server will start as that user. You should never run it as root.


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.