LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2011, 11:59 AM   #1
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Rep: Reputation: 15
how to ssh to a home linux computer


The linux machine is under my home wireless network. ifconfig only shows local ip which is 192.168.1.101. Is there a way to ssh to it from outside? What is the real IP of this computer?
 
Old 01-22-2011, 12:09 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To find the ip from your connection, goto
http://www.whatismyip.com
Some thoughts:
In general the ip will change every time you make a connection to your provider
You need to forward port 22 on the router to the server.
Make sure your provider doesn't block port 22
You could use dyndns to create a name for your connection, which will update the ip everytime you connect
http://www.dyndns.com/

Kind regards

Last edited by repo; 01-22-2011 at 12:12 PM.
 
Old 01-22-2011, 01:28 PM   #3
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by repo View Post
To find the ip from your connection, goto
http://www.whatismyip.com
Some thoughts:
In general the ip will change every time you make a connection to your provider
You need to forward port 22 on the router to the server.
Make sure your provider doesn't block port 22
You could use dyndns to create a name for your connection, which will update the ip everytime you connect
http://www.dyndns.com/

Kind regards
I got the ip and tried to ssh to it from another windows computer. But I can't connect to it. It said the host is unreachable. The host may be down or there may be a problem with the network connection Sometimes such problems can also be caused by a misconfigured firewall.
In my secure shell, I did set the port to 22 (which is default). Is it what you mean by "forward port 22 on the router to the server"?
 
Old 01-22-2011, 01:38 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
If you use a router, you need to forward port 22 to the ip from your server on the router.
On the server, you need to disable the firewall, or open port 22.
Is your ssh daemon running on the server?
Can you ssh on the server itself?
on the server, open a terminal and type
Code:
ssh 127.0.0.1
Can you connect from another computer in the LAN ?
Code:
ssh 192.168.1.101
Are you connecting from the LAN to the outside and back in?
Try to connect from the outside.
You an use
http://www.t1shopper.com/tools/port-scan/
To see if your port 22 is open.

Kind regards
 
Old 01-22-2011, 02:58 PM   #5
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Original Poster
Rep: Reputation: 15
I can ssh to itself. Also tried another machine in the LAN (ssh 192.168.1.101), it worked.

The link for testing the ports shows that the port 22 is not responding. I assume this means 22 is not open. How do I open port 22 then? I did what some people suggested by start the sshd
/etc/rc.d/init.d/sshd start but it didn't work.
 
Old 01-22-2011, 03:01 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You need to forward port 22 to the server on the router, and make sure your provider doesn't block port 22

Kind regards
 
Old 01-22-2011, 03:48 PM   #7
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
If you have your ip You can use putty from a windows machine or you can use ssh from a linux machine. If you are connected trhough a router go into its gui which would be something like 192.168.1.1 or 192.168.1.254 and open port 22 and forward it to 192.168.1.101.

Now how to open the port you need to check your router manual. Please tell us the make and model of your router also if you have a fire wall on your computers you may need to edit that as well.

Now if you have changed the port you need to access it something like this

Code:
$ ssh username@ipaddress -p port
where username would be the username of the machine and where port is would be the port number if not 22.
 
Old 01-24-2011, 12:15 AM   #8
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Original Poster
Rep: Reputation: 15
I have a trendnet 432brp. It seems some other trendnet would let you forward the port under "gaming" menu. But mine is different. I guess PFconfig would do the trick, but it's not a free software. Is there any other way to fix it?

Quote:
Originally Posted by jmc1987 View Post
If you have your ip You can use putty from a windows machine or you can use ssh from a linux machine. If you are connected trhough a router go into its gui which would be something like 192.168.1.1 or 192.168.1.254 and open port 22 and forward it to 192.168.1.101.

Now how to open the port you need to check your router manual. Please tell us the make and model of your router also if you have a fire wall on your computers you may need to edit that as well.

Now if you have changed the port you need to access it something like this

Code:
$ ssh username@ipaddress -p port
where username would be the username of the machine and where port is would be the port number if not 22.
 
Old 01-24-2011, 02:20 AM   #9
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by nasridine View Post
I have a trendnet 432brp. It seems some other trendnet would let you forward the port under "gaming" menu. But mine is different. I guess PFconfig would do the trick, but it's not a free software. Is there any other way to fix it?
http://www.zultrax.com/forward-port/...tew-432brp.htm

This my show you how to forward it. I didn't read it fully but it looks like it has some usefull stuff in it. Now you can also put your computer in DMZ mode through the router but be aware that it opens all ports up on your system. So If you do this I would suggest make sure you have a local firewall up on your system.
 
  


Reply


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
how to SSH to work computer behind a firewall from home port forwarding not possible tkmsr Linux - Server 3 05-05-2010 12:20 PM
How to set it up so I can ssh to home computer? Krelian Linux - Software 6 08-04-2006 03:14 PM
ssh into my home ubuntu computer taiwf Linux - Networking 2 01-16-2006 06:31 PM
trying to ssh to my home computer bwoodwar Linux - Newbie 2 09-15-2005 10:20 AM
Question About Linux and Home Computer steven Linux - Software 8 01-23-2002 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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