Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: VNC over SSH question.

  1. #1
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    VNC over SSH question.

    Hi all,

    I previously had a problem with VNC not recognising my keyboard input, and during the discussion on that thread I got the impression that my method for VNC-ing to my box was potentially not secure.

    My solution was to change to using FreeNX, or exporting X over my SSH connection - depending on the circumstance.

    However my concern on my methodology still stands, so I would like your input.

    Here is how I started my VNC server, and then logged into the connection....

    1. SSH into my box from my laptop.
    [ ssh davem@MyHomeServer ]

    2 now at my server connection I start the VNC server
    [ tightvncserver start ]

    3 open up the VNC client on my laptop pointing it toward 'MyHomeServer' - using xvnc4server

    The discussion on the other thread gives me the feeling that this method isn't secure?

    Please note that this is no longer an issue as I am now using FreeNX - I am asking this question purely from a position of wanting to better understand why what I was doing was wrong.

    Thanks in advance
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  2. #2
    Join Date
    Feb 2008
    Beans
    606
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: VNC over SSH question.

    1. Configure the VNC server to only listen on localhost.
    2. Start the server.
    3. SSH from anywhere into the machine running the VNC server and tell ssh to forward localhost:5901 on your local machine to localhost:5901 on the machine running the VNC server.
    4. Run VNC viewer on your local machine and tell it to connect to localhost:1.

    You then connect to localhost:5901 and ssh forwards that to the remote machine through an encrypted tunnel.

    I think the command is ssh -L localhost:5901:localhost:5901 user@remote, but don't quote me on that .

  3. #3
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: VNC over SSH question.

    Quote Originally Posted by theDaveTheRave View Post
    Please note that this is no longer an issue as I am now using FreeNX - I am asking this question purely from a position of wanting to better understand why what I was doing was wrong.

    Thanks in advance
    VNC has two security flaws:

    1. The connection is not encrypted by default.

    2. The only thing that prevents an intruder from using the connection is a password. All too often people either use weak passwords or what they though was a strong password is actually weak.

    If you use ssh, you should use keys and disable password logins.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  4. #4
    Join Date
    Apr 2009
    Location
    CA, USA
    Beans
    156
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: VNC over SSH question.

    Are we talking about connecting to your Desktop from inside or outside your LAN? If inside the LAN then security is not much of a concern, just make sure all ports are blocked to the outside world. If outside then like bodhi.zazen mentioned, if you want to use VNC Server securely you really need to be establishing a SSH tunnel with private keys, no password authentication, or you could also setup a VPN connection to the network and block any other external ports. Then local security is not much of a concern if this is a private controlled network. Even with using FreeNX I would typically connect through a VPN tunnel so that no ports are open to local PC's directly.

  5. #5
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: VNC over SSH question.

    Quote Originally Posted by cgb View Post
    Are we talking about connecting to your Desktop from inside or outside your LAN? If inside the LAN then security is not much of a concern, just make sure all ports are blocked to the outside world. If outside then like bodhi.zazen mentioned, if you want to use VNC Server securely you really need to be establishing a SSH tunnel with private keys, no password authentication, or you could also setup a VPN connection to the network and block any other external ports. Then local security is not much of a concern if this is a private controlled network. Even with using FreeNX I would typically connect through a VPN tunnel so that no ports are open to local PC's directly.
    That's a good point. I hardly even use VNC even inside my lan at home. It's either FreeNX or nothing.

    If I am working remotely (which I have been lately), I connect to my server with SSH (key-auth only) and then create a tunnel to whatever machine I want to connect to, then connect with localhost:someportnumber.

    FreeNX really is way better then VNC when it comes to high latency links.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  6. #6
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: VNC over SSH question.

    Hi guys.

    Thanks for the input, you've definately cleared things up for me.

    So here is my current understanding.

    Although I was connecting through SSH (using rsa_id keys and not a password) I was then starting VNC in an insecure method.

    I should have continued to pass the command

    ssh -L localhost:5901:localhost:5901 user@remote

    to my vnc server from within my ssh shell effectively creating the required tunnel.

    As I would like to just point out. I am now using FreeNX (which was very easy to set up, once I had the SSH working) or if I only need to view a few output lines and not do any 'it is easier using the GUI' stuff I would simply forward X for my ssh login (which again is very cool).

    Also I mostly only use this from within my local 'home' network. Although I'm thinking of setting up port forwarding for my SSH so as I can log in from anywhere, but I don't require it yet so I'm not going to set it up.

    Thanks again to the community for being so cool with 'relative newbs' - we are all newbs at something!

    David
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  7. #7
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,791

    Re: VNC over SSH question.

    Howdy,

    Once you got SSH working, you don't really need VNC.

    Try this:
    $ ssh -C -c blowfish -X user@server gnome-panel

    VNC should not be lightly discarded. It should be thrown, with great force.

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: VNC over SSH question.

    Quote Originally Posted by HermanAB View Post
    Howdy,

    Once you got SSH working, you don't really need VNC.

    Try this:
    $ ssh -C -c blowfish -X user@server gnome-panel
    I've seen you mention that many, many times and it works really well.

    I've been using FreeNX, myself, but that's cuz I like suspending the session instead of having to close everything.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: VNC over SSH question.

    Quote Originally Posted by CharlesA View Post
    I've been using FreeNX, myself, but that's cuz I like suspending the session instead of having to close everything.
    that is what screen is for =)
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: VNC over SSH question.

    Quote Originally Posted by bodhi.zazen View Post
    that is what screen is for =)
    Even the graphical apps that were forwarded over X?

    I've used screen many times for CLI apps, but not for graphical apps.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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