Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-02-2008, 08:02 PM   #1
LQ Newbie
Registered: May 2005
Posts: 1

Rep: Reputation: 0
Setting up ssh to my home computre

I would like to be able to contact my home computer from my laptop while on the road. Then I would like to be able to check my email (using the email client on my home system), check stocks, bank stuff, etc. Naturally, I want all this to be on a secure connection since I would be doing this from a Starbucks or some place like that.

My laptop runs SUSE 10.2. My home system runs SUSE 10.1, so we are talking Linux to Linux, probably connecting from the laptop to the home system via ssh, and sshd running on the home system.

The home system connects via a wireless router to my router, which is which connects to my internet provider. The home system connects to the router using DHCP, and the router also uses DHCP to connect to my provider. That means that I can't depend on the knowing the IP address when I connect to my router. I plan to set up the router to port forward the ssh port to the home system.

So, question 1: How can I (dynamically) find out my home IP address so I can enter
> ssh me@<host or IP>
I have heard there are service on the web that can do this, but don't know where to look.

2: What do I have to set up in ssh.config and /etc/ssh/ssh_config in order to make the connections, and allow programs on the home system to use the laptops X server?

I would certainly appreciate information that will allow be to find where the documentation to do this stuff is.

Old 03-02-2008, 08:24 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You need to forward port 22 on the router to your home desktop. Doing that, it may fix the IP address assigned to the desktop, or use the hostname to re-forward to the new address.
Your router's status page will list the internet address of your router. If you have a router with a built in NAT router port, then you may need to access the routers status page or use "traceroute" to discover it. An always on cable modem may change the IP very rarely. There are dynamic dns services you can subscribe to.

To use X on your laptop, use the command "ssh -X user@host". Also edit /etc/ssh/sshd_config and enable X forwarding.
Also consider changing the port you use from 22 to one above 1024. This will reduce the number of script kiddie attacks. You can change the port number in sshd_config as well. Forward this new port instead of 22 in the router. Then you can either use "ssh -X -p <port #> user@host" or edit the port number in /etc/ssh/ssh_config on your laptop, and /etc/ssh/sshd_config for your desktop.

Also edit sshd_config to only allow protocol 2. Another good idea is to disable root logons and add "AllowUsers <Your User Name>". Root logons are a bad idea. It is a known user and a popular target of attackers. The "AllowUsers" entry will only allow logins from the users listed.

Also note that if your username is different on the two computers, when on the laptop, the user you logon as should be the desktop username not the laptops.

There are manpages for both sshd_config and ssh_config.

Last edited by jschiwal; 03-02-2008 at 08:26 PM.
Old 03-02-2008, 08:33 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
I forgot that you should run "ssh-keygen" on both systems to generate public and private keys. Log in from one computer to the other to add entries to ~/.ssh/known_hosts.

In /etc/ssh/ssh_config, use either the default "ask" or "no" for StrictHostKeyChecking. Make sure it isn't "no". Also check the permissions on your home directory. Make sure that your home directory isn't world writable.
Old 03-02-2008, 08:49 PM   #4
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
There's a few different things there. You should be able to get your IP address manually from Another way is to use someone like for dynamic DNS and install an update client on your home box so that you only need to remember a name, instead of an IP number.

Once you've done that, you can forward port 22 (or whatever port you run SSH on) from your router to your box. At this point you should be able to SSH to your home box.

I run nomachine NX on my home box. On my remote boxes I have the nx client running so I can run firefox, thunderbird or fluxbox, etc. over the connection. There's also freenx but I haven't tried that.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 05:38 PM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 04:15 PM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 03:37 PM
want to ssh/ftp to home machine (Slack) from office through home router fincher69 Linux - Networking 2 09-21-2005 11:55 PM
can't ssh to home jefferson117 Linux - Newbie 3 11-08-2002 12:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration