Mac OSX Server and SSH and VNC

Discussion in 'Mac OS X Server, Xserve, and Networking' started by wyattbiker, Dec 22, 2009.

  1. macrumors member

    Joined:
    Mar 7, 2009
    #1
    I've enabled VNC remoting on my server Snow Leopard

    I use the following command to login remotely to 192.168.xxx.nnn:

    #ssh www.myremoteserver.com -l myusername

    which works fine but when I try to use VNC to view the desktop, it fails to connect. I installed Chicken of the VNC. Internally this works fine. I have all standard ports.

    Any ideas?

    Thanks
     
  2. macrumors member

    Joined:
    Mar 4, 2009
    Location:
    Northern Ireland
    #2
    The reason, I believe, that this won't work, is because you aren't specifying the port number for which you are creating the secure tunnel in on, so in theory, you are simply creating a single secure tunnel in on port 22.

    If you are using Snow Leopard Server, why not simply create a VPN, that way, once you're connected, you'd have full access to everything you need.
     
  3. macrumors 601

    Joined:
    Aug 15, 2005
    #3
    Yes, use:
    Code:
     ssh -L localhost:5900:<internal IP of host you want to connect to>:5900 <username>@<public IP or domain>
    Then when you fire up the VNC client, type localhost. Also note that some VNC servers and clients require this to be enabled for it to accept localhost.

    Depending on what network you connect to, outbound VPN may not be an option. Using SSH only gives you greater flexibility.
     
  4. macrumors 65816

    Joined:
    Jan 1, 2008
    #4
    In addition, there's no need for Chicken of the VNC. You can use 'open vnc://hostname: <port> in Terminal to bring up Screen Sharing.

    A.

    ps: there's no space between the colon and portnumber, it's there only to avoid a smiley.
     
  5. thread starter macrumors member

    Joined:
    Mar 7, 2009
    #5
    Worked like a charm with Chicken using localhost, but the 'open vnc://hostname:5900' brings up a message on the server screen saying that a screen cannot share itself or something to that effect.
     
  6. macrumors 65816

    Joined:
    Jan 1, 2008
    #6
    It is true that 'localhost:5900' is a special case. If you are using ssh as described by belvdr, I would suggest a different local port anyway, as you will have a conflict if you ever turn on screen sharing locally.

    A.
     
  7. macrumors newbie

    Joined:
    Feb 3, 2010
    #7
    My workaround

    The target computer must have file sharing selected, and the user name that you intend to use added. You can find this under system preferences > sharing > (then select which folder you want to share)

    Larry Warner
     
  8. macrumors 601

    Joined:
    Aug 15, 2005
    #8
    So enabling file sharing allowed vnc to connect to localhost?
     
  9. macrumors regular

    Joined:
    Jul 10, 2008
    Location:
    UK
    #9
    You can run into problems if you also have screen sharing enabled on the machine you are running the vnc client on. To avoid this use a port number other than 5900 for the localhost port of the ssh command. For instance:

    ssh -L localhost:6900:<internal IP of host you want to connect to>:5900 <username>@<public IP or domain>

    Then you should be able to connect to the remote machine as vnc://localhost:6900

    I find an application like SSH Tunnel Manager to be useful in automatically starting and maintaining ssh connections if you tend to use them regularly. If you look around someone has compiled the latest version for Intel.
     

Share This Page