Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 22, 2009, 12:43 PM   #1
wyattbiker
macrumors member
 
Join Date: Mar 2009
Mac OSX Server and SSH and VNC

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
wyattbiker is offline   0 Reply With Quote
Old Dec 22, 2009, 03:06 PM   #2
TheCoupe
macrumors member
 
Join Date: Mar 2009
Location: Northern Ireland
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.
TheCoupe is offline   0 Reply With Quote
Old Dec 22, 2009, 04:31 PM   #3
belvdr
macrumors 68040
 
Join Date: Aug 2005
Quote:
Originally Posted by wyattbiker View Post
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
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.

Quote:
Originally Posted by TheCoupe View Post
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.
Depending on what network you connect to, outbound VPN may not be an option. Using SSH only gives you greater flexibility.
belvdr is offline   0 Reply With Quote
Old Dec 22, 2009, 05:49 PM   #4
Alrescha
macrumors 65816
 
Join Date: Jan 2008
Location: Boston, MA
Quote:
Originally Posted by wyattbiker View Post
I installed Chicken of the VNC.
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.
Alrescha is offline   0 Reply With Quote
Old Dec 22, 2009, 06:34 PM   #5
wyattbiker
Thread Starter
macrumors member
 
Join Date: Mar 2009
Quote:
Originally Posted by Alrescha View Post
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.
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.
wyattbiker is offline   0 Reply With Quote
Old Dec 23, 2009, 11:23 AM   #6
Alrescha
macrumors 65816
 
Join Date: Jan 2008
Location: Boston, MA
Quote:
Originally Posted by wyattbiker View Post
'open vnc://hostname:5900' brings up a message on the server screen saying that a screen cannot share itself or something to that effect.
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.
Alrescha is offline   0 Reply With Quote
Old Feb 3, 2010, 03:41 PM   #7
warnerl
macrumors newbie
 
Join Date: Feb 2010
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
warnerl is offline   0 Reply With Quote
Old Feb 4, 2010, 06:35 AM   #8
belvdr
macrumors 68040
 
Join Date: Aug 2005
Quote:
Originally Posted by warnerl View Post
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
So enabling file sharing allowed vnc to connect to localhost?
belvdr is offline   0 Reply With Quote
Old Feb 5, 2010, 12:25 PM   #9
Serif
macrumors regular
 
Join Date: Jul 2008
Location: UK
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.
Serif is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Ssh server. How to block all internet traffic except ssh? Mikehuang OS X Mavericks (10.9) 3 Mar 30, 2014 09:55 PM
Mac Mini and OSX Server. benefits? Macs4u Mac OS X Server, Xserve, and Networking 7 Feb 14, 2013 07:35 PM
Mac OSX Server 10.8 Print shares djzolla OS X 10.8 Mountain Lion 1 Jan 23, 2013 08:50 AM
Resolved: Brand new mac mini server throwing artifacts on the vnc session stijndg Mac mini 2 Dec 7, 2012 09:09 AM

Forum Jump

All times are GMT -5. The time now is 07:57 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC