LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 03: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, 05:13 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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, 07:12 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
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, 07: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, 08:11 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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 08:13 AM.
 
  


Reply



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 7 08-07-2018 08:41 AM
Problem in remote ssh port using Port Forwarding jsaravana87 Linux - Server 1 09-27-2012 12:02 AM
Port number used by server when using dynamic port forwarding in SSH? kreeder Linux - Networking 4 11-21-2011 02:07 PM
ssh port forwarding not working tommiy Linux - Networking 1 04-22-2007 08:33 AM
Port forwarding just isnt working... Apache / xinetd Please help! liquidskin Linux - Networking 3 09-09-2003 04:12 PM

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

All times are GMT -5. The time now is 11:38 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
Open Source Consulting | Domain Registration