Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > how best to ssh tunnel in to a machine at home?

how best to ssh tunnel in to a machine at home?
Thread Tools
Grizzled Veteran
Join Date: Nov 2002
Location: London, UK
Status: Offline
Reply With Quote
Oct 4, 2005, 09:53 AM
 
Hey all,

I'm going to be away from home for a few months, but would like to be able to ssh into my home server occasionally if there are any problems. I'd like to be able to use either vnc or remote desktop so that I have a graphical view of the system for doing things like installing updates etc.

Can you suggest the best way of going about this, setting up an ssh tunnel and getting into my machine securely.

Cheers,

J.
By all means let's be open-minded, but not so open-minded that our brains drop out - Richard Dawkins
     
Dedicated MacNNer
Join Date: Nov 2003
Location: Oslo, Norway
Status: Offline
Reply With Quote
Oct 4, 2005, 12:41 PM
 
Turn on "Remote login" on your server at home. Then open and forward tcp port 22 through your network to your server. Then you can use SSH to access it from anywhere.

You can also use an SSH tunnel to secure your VNC connection:
1. Run OSXvnc on the server and set it to "Only allow local connections".
2. Create the SSH tunnel "ssh -l username domain -L 5900:127.0.0.1:5900" (where 'domain' is the domain name or ip address to your home server).
3. Use a VNC client and connect to "localhost"
     
Grizzled Veteran
Join Date: Nov 2002
Location: London, UK
Status: Offline
Reply With Quote
Oct 4, 2005, 06:39 PM
 
Originally Posted by albook
Turn on "Remote login" on your server at home. Then open and forward tcp port 22 through your network to your server. Then you can use SSH to access it from anywhere.

You can also use an SSH tunnel to secure your VNC connection:
1. Run OSXvnc on the server and set it to "Only allow local connections".
2. Create the SSH tunnel "ssh -l username domain -L 5900:127.0.0.1:5900" (where 'domain' is the domain name or ip address to your home server).
3. Use a VNC client and connect to "localhost"
Thanks very much for that, I'll try it out in the next couple of days.

Cheers,

J.
By all means let's be open-minded, but not so open-minded that our brains drop out - Richard Dawkins
     
Grizzled Veteran
Join Date: Nov 2002
Location: London, UK
Status: Offline
Reply With Quote
Oct 4, 2005, 07:06 PM
 
Originally Posted by albook
Turn on "Remote login" on your server at home. Then open and forward tcp port 22 through your network to your server. Then you can use SSH to access it from anywhere.

You can also use an SSH tunnel to secure your VNC connection:
1. Run OSXvnc on the server and set it to "Only allow local connections".
2. Create the SSH tunnel "ssh -l username domain -L 5900:127.0.0.1:5900" (where 'domain' is the domain name or ip address to your home server).
3. Use a VNC client and connect to "localhost"
Thanks very much for that, I'll try it out in the next couple of days.

Cheers,

J.
By all means let's be open-minded, but not so open-minded that our brains drop out - Richard Dawkins
     
Grizzled Veteran
Join Date: Nov 2002
Location: London, UK
Status: Offline
Reply With Quote
Oct 4, 2005, 09:51 PM
 
Thanks Albook, that worked beautifully. Now I'm just figuring out how to set up ssh tunnel manager to do the same thing.

Cheers,

J.
By all means let's be open-minded, but not so open-minded that our brains drop out - Richard Dawkins
     
Mac Elite
Join Date: May 2002
Location: Los Angeles, CA.
Status: Offline
Reply With Quote
Oct 4, 2005, 10:55 PM
 
[QUOTE=albook]2. Create the SSH tunnel "ssh -l username domain -L 5900:127.0.0.1:5900" (where 'domain' is the domain name or ip address to your home server).
QUOTE]


is there a GUI program that will do that command? [also, how would you turn it off when done?]

thanks
     
Mac Elite
Join Date: May 2001
Location: Vancouver
Status: Offline
Reply With Quote
Oct 5, 2005, 12:44 AM
 
Don't forget to lock down SSH server with some basic precautions:

AllowUsers/DenyUsers in /etc/sshd_config
Disable Password Authentication
Enable Public Key (if possible)

Cheers.
Macbook (Black) C2D/250GB/3GB | G5/1.6 250GBx2/2.0GB
Free Mobile Ringtone & Games Uploader | Flickr | Twitter
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 5, 2005, 01:12 AM
 
Originally Posted by legacyb4
Disable Password Authentication
That's not good enough - the PasswordAuthentication setting gets overridden no matter what you set it to, unless you uncomment this line:

Code:
#UsePAM no

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Oct 5, 2005, 05:29 AM
 
You mentioned that the machine is a server so this may have already thought of this stuff, but it can't hurt:

unless you have a static IP address you should look into dyndns.

make sure the machine is set to turn itself back on after a power outage.

you may also want to allow outside access to your router - this is a security risk, but what if you need to open a port you hadn't thought of? Some routers let you do this and can restrict access. Probly a bad idea but something to think about.

Are your phone/cable/power bills payed? Might be hard to get the power back on if you are out of town and they pull your chain.

Make sure to try it a couple of times from a friends house. See if you can really do everything you want to.

Did you leave the iron on?
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
     
Grizzled Veteran
Join Date: Nov 2002
Location: London, UK
Status: Offline
Reply With Quote
Oct 5, 2005, 04:01 PM
 
Thanks for the extra replies. Very helpful.

Badtz: Yes there's a gui for this, it's called ssh tunnel manager, and I have just set it up to manage the tunnel for this. Neat app.

Gavin: Yep, I have dyndns running, the machine is set for restarts, bills are up to date (my wife will be at home) and I've made sure the iron is off. Good thoughts, thanks. Hadn't thought of the router, will look into that.

Legacy: why would you disable the password, don't you want password protection otherwise how are you able to log in and prove you're the correct user? Maybe I'm missing something on that one.

Cheers,

J.
By all means let's be open-minded, but not so open-minded that our brains drop out - Richard Dawkins
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Oct 5, 2005, 04:12 PM
 
Originally Posted by Freeflyer
Legacy: why would you disable the password, don't you want password protection otherwise how are you able to log in and prove you're the correct user? Maybe I'm missing something on that one.
It means that instead of typing an 8-character password, you'd have a private key instead. The key can be 1024, 2048, or even 4096 bits long, as opposed to an 8-char password which would only be 64 bits. Plus, if you have password authentication turned on, anyone can just keep guessing and brute force attack the password. Good luck doing that with a 4096-bit key...

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:10 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2