Detailed Description: Tunnelling VNC through OpenSSH in Kali Linux 2.1.2 on Raspberry Pi 2
Error I'm Receiving: "Error: Can't open display:"
Thorough Background Info:
I'm trying to get VNC to tunnel through SSH so my VNC communications are encrypted. I'm doing this on my home network via wireless for the time being. I followed some instructions here http://www.penguintutor.com/linux/tightvnc. Unfortunately I can't get VNC to tunnel through SSH despite spending quite a number of hours on it.
My Raspberry Pi 2 is running the newest image of Kali Linux made specifically for the Pi 2 (version 2.1.2 from kali.org).
Here is what I did:
Installed OpenSSH server: made new SSH keys to replace the defaults (protection against MITM), changed the default port.
Installed vncserver:
Started both services on the Pi 2 and confirmed they were working/listening with the commands "chkconfig -l" and "netstat -plant".
Successfully Connected to my Pi 2 via SSH with the command "ssh username@ip-address -p new_port# -L 5901:localhost:5901"
Ran xtightvncviewer 127.0.0.1:1
Received the error message "Error: Can't open display:"
I tried connecting to the Pi from a Windows 7 machine via Putty (made sure to add the tunneling info), and a Linuxbox (with the xtightvncviewer command specified above)
Not sure what to do now. I figured the X stytem is different in Kali from what is in VNC's settings, so I tried changing the /etc/X11 line in my /.vnc/xstartup file to this -> exec
ck-launch-session startxfce4 but, unfortunately I still get "Error: Can't open display:".
Any help would be greatly, greatly
appreciated.