ADD VNC USERS
We will be using user=client2 it will differ in your case. You can use any username for the same.
adduser client2
root@server1:~# adduser client2
Adding user `client2' ...
Adding new group `client2' (1001) ...
Adding new group `client2' (1001) ...
Adding new user `client2' (1001) with group `client2' ...
Creating home directory `/home/client2' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: <--yourpassword
Retype new UNIX password: <--yourpassword
passwd: password updated successfully
Changing the user information for client2
Enter the new value, or press ENTER for the default
Full Name []: <--ENTER
Room Number []:<--ENTER
Work Phone []:<--ENTER
Home Phone []:<--ENTER
Other []:<--ENTER
Is the information correct? [Y/n]<--ENTER
Once the client is added
Start the vncserver with the user, for this use:
Then access the desktop by entering the passwords created previously.
su client2
vncserver
You will require a password to access your desktops.
Password: << enter the password used on the VNC connection
Verify: << confirm the password
xauth: file /home/client2/.Xauthority does not exist
xauth: (stdin):1: bad display name "vps.server.com:3" in "add" command
New 'vps.server.com:3 (client2)' desktop is vps.server.com:3
Creating default startup script /home/client2/.vnc/xstartup
Starting applications specified in /home/client2/.vnc/xstartup
Log file is /home/client2/.vnc/vps.server.com:3.log
As you can see "New 'vps.server.com:3 (client2)' desktop is vps.server.com:3", here ":3" implies the port 5903.
So, Your VNC access port for this user is 5903
client2@vps:/root$ vncserver -kill :3
Killing Xvnc4 process ID 22627
client2@vps:/root$ cd /home/client2/
client2@vps:~$ nano ~/.vnc/xstartup
Make sure it looks like
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
client2@vps:~$ vncserver :3
xauth: (stdin):1: bad display name "vps.server.com:3" in "add" command
New 'vps.server.com:3 (client2)' desktop is vps.server.com:3
Starting applications specified in /home/client2/.vnc/xstartup
Log file is /home/client2/.vnc/vps.server.com:3.log
Now you can VNC into the server using SERVER_IP:5903 for this user.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS