LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-02-2012, 02:40 PM   #1
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Rep: Reputation: 15
Ubuntu 11.10 - How to setup ssh host?


I'm currently trying to allow my computer to be remotely accessed via ssh. The computer is running Ubuntu 11.10. I've used ssh on several occasions in the past, but I've only used the basic features and I've always been on the client side.

I've installed ssh and when try something like:
Code:
ssh localhost
It seems to work without a problem. The problem arises when I to ssh via my public IP:
Code:
ssh XX.XX.XX.XX
This will sit there for quite a while then return something along the lines of:
Code:
ssh: connect to host XX.XX.XX.XX port XX: Connection timed out
I'm attempting to use the host computer to try to connect to itself through the public IP for testing purposes, but I don't think that should be the cause of the problem. I suspect that it has to do with the settings on my router, but I'm not sure. Any suggestions? Thanks.
 
Old 01-02-2012, 02:53 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
So your computer is behind a router. Do you have port forwarding set up on the router to forward port 22 to the machine running sshd?
 
1 members found this post helpful.
Old 01-02-2012, 03:06 PM   #3
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
Quote:
So your computer is behind a router. Do you have port forwarding set up on the router to forward port 22 to the machine running sshd?
Thanks for the quick reply. I attempted to setup the port forwarding, but I likely have done something incorrectly. Also, I changed the ssh server from port 22 to another port and my commands to connect have actually been something more along the lines of:
Code:
ssh -p XX localhost
In any case, the same timeout error arises using port 22 or not. So likely it is the port forwarding. I have added forwarding entries for UCP and TCP on port 22 or equivalent to the local address of my machine. As far as I can tell, it looks like it's correct, but clearly it's not working so I must be doing something wrong. Any idea from here?
 
Old 01-02-2012, 03:16 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Could it be your ISP is blocking ports?

Kind regards
 
Old 01-02-2012, 03:29 PM   #5
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
How might I go about finding out what ports my ISP are blocking?
 
Old 01-02-2012, 03:37 PM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,221
Blog Entries: 1

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
Normally the isp blocks standard ports as you have changed ssh port it should be ok have you checked what ports are open from the outside http://nmap-online.com/
 
1 members found this post helpful.
Old 01-02-2012, 03:41 PM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Ask them, look at the website.
You could however try to connect from another computer, outside your LAN.
Some routers don't support requests from the inside to the outside and back in.
Try an online portscanner.
http://www.derkeiler.com/Service/PortScan/

Kind regards
 
1 members found this post helpful.
Old 01-02-2012, 04:06 PM   #8
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
Thanks again for the replies thus far.
Quote:
Normally the isp blocks standard ports as you have changed ssh port it should be ok have you checked what ports are open from the outside http://nmap-online.com/
I used this link and based on it's results I see that the port I have for the ssh is tcp and it is open. So perhaps the router is setup correctly and it's just having problems when it is redirected to my machine? Does Ubuntu initially have any firewall or anything which would prevent the connection? Just as a reminder, I'm still receiving the time out error.

Specifically the results of the nmap scan is:
Code:
PORT STATE SERVICE
XX/tcp open ssh
Where XX is the port number I attempt to use.

Any idea what to try next?
 
Old 01-02-2012, 04:16 PM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Seems to me ssh is working.
Try from another computer outside your LAN.

Kind regards
 
1 members found this post helpful.
Old 01-02-2012, 04:24 PM   #10
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,221
Blog Entries: 1

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
Yes it has ufw
Code:
sudo ufw status
should return status inactive
 
1 members found this post helpful.
Old 01-03-2012, 12:24 AM   #11
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
Yes, it's working correctly. I just couldn't connect to the ssh host from the host itself. Thank you much all for your help!
 
  


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
Server setup using Ubuntu for SSH account hosting for socks proxy? rdawgjigga Linux - Server 1 03-21-2010 09:30 PM
How do I Host a Direct Online??? Ubuntu Server LAMP Setup jsullivan44 Linux - Server 1 09-19-2009 06:06 PM
Please help me setup Local Area Network. I cannot ping Windows XP host from Ubuntu 9 avarashnon Linux - Newbie 1 05-10-2009 08:59 PM
Ubuntu 6.06 Server(SSH Setup/Putty) TechMansoor Linux - Networking 1 12-16-2006 10:05 PM
How to setup a host.deny and host.allow for SSH? explorer1979 Linux - Security 2 01-31-2005 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration