Changes

Jump to navigation Jump to search
apt-get install plperl
 
==Install and configure TightVNC and xfce desktop==
===Installation===
apt install xfce4 xfce4-goodies tightvncserver
 
===Configure VNC server===
Created a configuration file for VNC startup:
 
nano ~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
 
*The first command in the file, xrdb $HOME/.Xresources, tells VNC's GUI framework to read the server user's .Xresources file. .Xresources is where a user can make changes to certain settings of the graphical desktop, like terminal colors, cursor themes, and font rendering.
*The second command simply tells the server to launch XFCE, which is where you will find all of the graphical software that you need to comfortably manage your server.
 
Granted executable privilege:
sudo chmod +x ~/.vnc/xstartup
 
===Create a VNC service file===
First, opened a new service file in /etc/init.d with nano:
sudo nano /etc/init.d/vncserver
 
The first block of data will be where we declare some common settings that VNC will be referring to a lot, like our username and the display resolution.
 
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="mcnair"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1920x1080"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions
 
Next, we can start inserting the command instructions that will allow us to manage the new service. The following block binds the command needed to start a VNC server, and feedback that it is being started, to the command keyword start.
case "$1" in
vncstart)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
 
The next block creates the command keyword stop, which will immediately kill an existing VNC server instance.
vncstop)
log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
 
The final block is for the command keyword restart, which is simply the two previous commands (stop and start) combined into one command.
vncrestart)
$0 vncstop
$0 vncstart
;;
esac
exit 0
 
Made this service script executable:
sudo chmod +x /etc/init.d/vncserver
 
Now try using the service and command to start a new VNC server instance:
sudo service vncserver vncstart
 
===Connect to VNC server===
First create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. On Linux or OS X (this requires the password for DB Server's non-root user mcnair):
ssh -L 5901:127.0.0.1:5901 -N -f -l mcnair 128.42.44.181
 
Now use Remmina/TightVNC Viewer/ETC to connect to the VNC server.
On Remmina, use localhost:5901. No username is fine. Password is: Go-AsK-Ed
 
[[File:Connection using Remmina.png]]
 
I am not an expert in Windows Shell and I am not sure how to SSH on Windows. The TightVNC Viewer has a ssh channel option, but I failed to connect to our VNC server on Windows.
==User management==

Navigation menu