Results 1 to 5 of 5

Thread: HELP: VNC Tunnel via OpenSSH

  1. #1
    Join Date
    2016-Apr
    Posts
    7

    HELP: VNC Tunnel via OpenSSH

    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.

  2. #2
    Join Date
    2013-Mar
    Posts
    10
    what's your xstartup file full content? mine is just

    #!/bin/bash
    startxfce4 &

    and is working fine

  3. #3
    Join Date
    2016-Apr
    Posts
    7
    #!/bin/sh

    xrdb $HOME/.Xresources
    xsetroot -solid grey
    #fix to make GNOME work
    export XKL_XMODMAP_DISABLE=1
    #/etc/X11/Xsession #Ths starts the X11 Window manager
    exec ck-launch-session startxfce4

  4. #4
    Join Date
    2016-Apr
    Posts
    7
    Quote Originally Posted by jnpa View Post
    what's your xstartup file full content? mine is just

    #!/bin/bash
    startxfce4 &

    and is working fine
    i also just tried using your xstartup settings, but that didn't help

  5. #5
    Join Date
    2016-Apr
    Posts
    7
    Quote Originally Posted by jnpa View Post
    what's your xstartup file full content? mine is just

    #!/bin/bash
    startxfce4 &

    and is working fine

    I'm properly connecting to the VNC via SSH tunnel now. Realized what the issue was: I was running the vnc viewer inside of the ssh connection (on the server - raspberry pi, from the various PC's in my network).

    My issue now is the dreaded grey screen in the VNC viewer. I tried your xstartup file again, but it still didn't help.

Similar Threads

  1. Replies: 0
    Last Post: 2018-09-10, 14:26
  2. Kali 2.0 easy-creds tunnel interface and dhcp error.
    By jeret in forum How-To Archive
    Replies: 0
    Last Post: 2015-11-13, 16:41

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •