INSTALL TIGHTVNC ON KALI LINUX RASPBERRY PI


Install TightVNC server using the following command


  • apt-get install tightvncserver

Run VNCserver to generate the configuration files.


  • vncserver :1

VNC sessions are not linked to Linux user authentication.It is just protected by a password.So, it is better to change your password.
Change your password using


  • vncpasswd

Run the command to check the VNC connection


  • netstat -tupln

Use a VNC application such as VNC CONNECT and login using the PI's IP Address.


Download the VNC CONNECT 

To run VNC over SSH, we can create a SSH tunnel.
Start your VNC server
  • vncserver :1 -geometry 1280x800 -depth 16 -localhost -nolisten tcp


-locahost option will ensure VNC port is listening only on local interface.
-nolisten tcp - X Server will not listen on the network.

Now, create a SSH tunnel 
  • ssh -L 5901:localhost:5901 -N -f <user>@<ip>


Any connection to this port will be tunneled by SSH.

ENABLE AT STARTUP

To enable VNC at boot,
  • nano /etc/init.d/vncboot


Paste the following code

#!/bin/sh
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO
USER=root
HOME=/root
export USER HOME
case "$1" in
 start)
   echo "Starting VNC Server"
   /usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -localhost -nolisten tcp
   ;;
 stop)
   echo "Stopping VNC Server"
   /usr/bin/vncserver -kill :1
   ;;
 *)
   echo "Usage: /etc/init.d/vncboot {start|stop}"
   exit 1
   ;;
esac
exit 0

Press ctrl+x then press y and hit enter to save it.
Give permission and update.
  • chmod 755 /etc/init.d/vncboot
  • update-rc.d vncboot defaults
Reboot your PI and it should be good to go.

Comments

Popular posts from this blog

ENABLE AUTOSTART FOR X11VNC

INSTALL X11VNC ON KALI LINUX RASPBERRY PI