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 11-30-2013, 08:59 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 173

Rep: Reputation: 0
openssh server not working, cannot ssh from remote pc


this is what i did,
0. my linux pc, local ip 192.168.1.2, external ip 200.1.2.3
1. installed openssh server
2. in the /etc/ssh/sshd_config, i changed port to 2222
3. restart pc
4. in my router, i added a port forwarding for TCP for 192.168.1.2 for dest port 2222

now i go to another pc at home, i can ssh into 192.168.1.2

now if i remote into a remote pc, from there ssh into 200.1.2.3, won't work.

What did i miss here ?
Many thanks !
 
Old 12-01-2013, 11:58 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I believe this is a port misconfiguration.
SSH server runs on pc, listens on 2222. So if you ssh from a pc in LAN, you ssh to 192.168.1.2:2222
If you want to connect to internal ssh-server from internet on port 2222, then you should have a pf-rule 2222 -> 192.168.1.2:2222. Then you can connect to 200.1.2.3:2222
 
Old 12-01-2013, 12:54 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
or just use the -p flag.

Code:
ssh -p 2222 remote_user@200.1.2.3
should do the trick.

also read the links in my cig to learn about ssh keys and config files to make your life easier.
 
Old 12-01-2013, 01:54 PM   #4
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
yes, it's the port forwarding issue, i struggled a little bit with route setting and it's working now.

Quote:
Originally Posted by pingu View Post
I believe this is a port misconfiguration.
SSH server runs on pc, listens on 2222. So if you ssh from a pc in LAN, you ssh to 192.168.1.2:2222
If you want to connect to internal ssh-server from internet on port 2222, then you should have a pf-rule 2222 -> 192.168.1.2:2222. Then you can connect to 200.1.2.3:2222


---------- Post added 12-01-13 at 01:54 PM ----------

cool, thanks !

Quote:
Originally Posted by lleb View Post
or just use the -p flag.

Code:
ssh -p 2222 remote_user@200.1.2.3
should do the trick.

also read the links in my cig to learn about ssh keys and config files to make your life easier.
 
  


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
ssh_config on openssh server not working ((debian 6)) alieblice Linux - Newbie 2 07-05-2011 02:48 AM
web interface for openssh-server (ssh over http) malayo Debian 1 02-10-2011 05:52 AM
Openssh not working when I try to connect my Linux server santhoshkumar Red Hat 1 04-05-2007 01:11 AM
Remote backup server: vsftpd/SSL or openssh/sftp or... ? krog Linux - Security 3 04-25-2006 12:50 AM
problems with openssh server (ssh) shodekiagari Linux - Networking 10 10-16-2005 06:37 AM


All times are GMT -5. The time now is 06:12 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