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 09-05-2013, 04:55 AM   #1
sunzeal
LQ Newbie
 
Registered: Sep 2012
Posts: 26

Rep: Reputation: Disabled
Port Forwarding working for Apache but not SSH


Inside my internal network, i have Apache and SSH running ( in virtual machine ).

I have configured my router to port forward.

When i try for port 80 of Apache, it seems working fine from external network , but when i change it to 22 ( SSH ) and try to connect via SSH [ through router's public IP ] , it won't work.

Am i doing something wrong ?
 
Old 09-05-2013, 06:13 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
Try enabling port forwarding on an different port (2222?) forwarding to your server on port 22 and see if that works. If it does then it's possible your router has remote management, and if it does then check to see if remote management by ssh is enabled on the external interface. If it's enabled then your router is getting the ssh traffic rather than passing it through.
 
Old 09-05-2013, 08:12 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
You didn't mention your distro.

Have you opened respected port in firewall?

Can you connect to ssh locally (LAN) or are you facing problem in any case?
 
Old 09-05-2013, 08:27 AM   #4
sunzeal
LQ Newbie
 
Registered: Sep 2012
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eklavya View Post
You didn't mention your distro.

Have you opened respected port in firewall?

Can you connect to ssh locally (LAN) or are you facing problem in any case?
CentOS 6

I can connect via SSH locally and firewall is turned off.
 
Old 09-05-2013, 09:11 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
try running sshd -d -d -d on the server and ssh -v -v -v on the client and see what debug messages pop up.

also, on fedora-live i had to make ssh a trusted service via system-config-firewall to get into my laptop (for some reason it was disabled by default).

Last edited by schneidz; 09-05-2013 at 09:13 AM.
 
  


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
[SOLVED] IPtables : ssh port forwarding one port to another port issue routers Linux - Networking 5 07-24-2013 01:20 AM
Problem in remote ssh port using Port Forwarding jsaravana87 Linux - Server 1 09-27-2012 01:02 AM
Port number used by server when using dynamic port forwarding in SSH? kreeder Linux - Networking 4 11-21-2011 03:07 PM
ssh port forwarding not working tommiy Linux - Networking 1 04-22-2007 09:33 AM
Port forwarding just isnt working... Apache / xinetd Please help! liquidskin Linux - Networking 3 09-09-2003 05:12 PM


All times are GMT -5. The time now is 10:39 AM.

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