LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2008, 04:56 PM   #1
SimbaSpirit
Member
 
Registered: Feb 2008
Posts: 109

Rep: Reputation: 15
SSH not working from other ubuntu server, but from windows?


Ok here's my setup.

I have 2 computers running the most up to date ubuntu (hardy, all updates intact), and a laptop running vista.

I follow the tutorials on the internet about how to ssh from terminal.

ssh username@servername:24 (have it on port 24 because other computer uses 22)

ssh username@192.168.1.99
ssh username@<external ip>

My router is using dd-wrt, and has ports 22 and 24 properly forwarded.

Server 1 can't ssh Server2, or the other way around.
My vista laptop using PuTTY can access both of them.

Am I using the command incorrectly?
To change the ports I edited the "port:" in ssh_config and sshd_config

Thanks,
-SS
 
Old 06-21-2008, 05:12 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why are you using port 24? Multiple computers can connect on port 22 and multiple servers can listen on port 22, so I don't follow your logic.

Do you have the ssh daemon running on the server? Do you have port 22/24 open on the firewall? Exactly what message do you get when you try to connect?
 
Old 06-21-2008, 05:31 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Is the <external ip> you have mentioned on the lan or on the internet somewhere else. If it is on site, you need to connect to it on the lan through a lan interface with a local ip. That interface needs the ssh port open as well in the firewall.

Also try using the verbose option "-v" to get more information on why you can't connect. It could be a connection problem or an authentication problem.
 
Old 06-21-2008, 09:34 PM   #4
SimbaSpirit
Member
 
Registered: Feb 2008
Posts: 109

Original Poster
Rep: Reputation: 15
Hey, thanks for your replies.

-v returns:

Code:
me@myserver:~$ ssh -v 66.58.130.227:24
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
ssh: 66.58.130.227:24: Name or service not known
I can, however, connect with windows to both of them, so I know ssh is running and is accepting connections on the ports I specified. I'm using my external IP (ISP assigned IP, not router-assigned) to connect, hence the different ports.

I don't have a firewall running on the linux machines, I don't have anything to safeguard.


Quote:
Why are you using port 24? Multiple computers can connect on port 22 and multiple servers can listen on port 22, so I don't follow your logic.

Do you have the ssh daemon running on the server? Do you have port 22/24 open on the firewall? Exactly what message do you get when you try to connect?
When I use my external IP address I have 22 and 24 forwarded so I can go straight to the computer I choose. If there's a way for both of them to listen on 22 and know which one I'm talking about then please share, you know something I don't :P

Last edited by SimbaSpirit; 06-21-2008 at 09:35 PM.
 
Old 06-22-2008, 12:11 AM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
No, your use of ports makes sense.

Your syntax is wrong. You need ssh -p24 IP
 
Old 06-22-2008, 01:29 PM   #6
SimbaSpirit
Member
 
Registered: Feb 2008
Posts: 109

Original Poster
Rep: Reputation: 15
That was exactly the problem! Thanks so much!
I shouldn't have assumed it would work the same as everything else I guess :P
 
Old 06-23-2008, 10:18 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Quote:
Originally Posted by billymayday View Post
Why are you using port 24? Multiple computers can connect on port 22 and multiple servers can listen on port 22, so I don't follow your logic.

Do you have the ssh daemon running on the server? Do you have port 22/24 open on the firewall? Exactly what message do you get when you try to connect?
If he also want to access his computers from the Internet, then he will be able to forward different ports at the router to different hosts. However most routers will enable one translate ports as well.
 
Old 06-23-2008, 10:31 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
That's what he said in post #4
 
Old 07-02-2008, 05:10 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Quote:
Originally Posted by from post #4
When I use my external IP address I have 22 and 24 forwarded so I can go straight to the computer I choose. If there's a way for both of them to listen on 22 and know which one I'm talking about then please share, you know something I don't

I meant that one may be able to forward from port 24 on the router input to port 22 on a certain machine, using the router's configuration alone. Which I believe was a question on post #4.

It depends on the router, but this would allow using the standard ssh server configurations.
 
Old 07-02-2008, 06:05 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
That's how I'd read it too.

Rgds
 
Old 07-02-2008, 11:26 PM   #11
SimbaSpirit
Member
 
Registered: Feb 2008
Posts: 109

Original Poster
Rep: Reputation: 15
Ok I see where you were coming from. While that would have worked too, it's more work than it's worth to do it that way at this point, as easy as it is xD

I put linux on my router not that long ago, so glad I did.
 
Old 07-03-2008, 06:06 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
You need to balance the work in configuring the router to forward the different ports to different IPs at port 22 versus the work needing to use different ports for each host when working inside the LAN. You either need to remember that hostA used port 22 while hostB uses port24, etc. or create a wrapper that remembers this for you. IMHO, it would be easier to have the hosts inside the LAN using the same port.

---
I am impressed that the Firefox browser flagged 'lan' as misspelled and LAN as correct and recognized IMHO!
 
  


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 id has changed on ubuntu 7.10 so unable to ssh in ... curtisa Linux - Security 3 05-15-2008 06:06 AM
Ubuntu Server GUI Via SSH - Possible??? abc27 Linux - Newbie 22 04-23-2008 02:10 PM
Ubuntu 6.06 Server(SSH Setup/Putty) TechMansoor Linux - Networking 1 12-16-2006 09:05 PM
ssh towards a windows server linsson Linux - Networking 4 03-29-2005 10:33 PM
SSH from windows to linux not working hamish Linux - Software 7 12-08-2004 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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