LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-11-2004, 09:21 AM   #1
big_gie
Member
 
Registered: Oct 2003
Distribution: Redhat
Posts: 35

Rep: Reputation: 15
Multiple server ids. Is it possible?


Hi,

I have 2 ssh servers behind a router. One is a web server and the other is a desktop.

I'm slowly migrating to Mandrake 10.1 on my laptop and I'm away from my lan. In windows, I ssh/sftp to both of the computers; each ssh server listen on a (different) non standard port.

In linux, the host is identified with its key, saved in ~/.ssh/known_host. I connect to the web server and everything is fine. But when I connect to the desktop, I get
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
and I can't connect.

How can I put 2 ids for the same IP/hostname in known_host???

Also, is it more or less secure to open sshd on another port than 22?

Thank you very much.
 
Old 11-11-2004, 09:41 AM   #2
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Re: Multiple server ids. Is it possible?

Quote:
Originally posted by big_gie
How can I put 2 ids for the same IP/hostname in known_host???
Ehhh... how are you trying to connect to these daemons? You can't have both systems with the same host name or both systems with the same IP address, so I'm a bit confused.
Quote:
Originally posted by big_gie
Also, is it more or less secure to open sshd on another port than 22?
That's a matter of opinion. On the one hand, running sshd on a non-standard port will (usually) prevent attacks from script kiddies who only look on port 22. On the other hand, your system is only as secure as you make it, so if you do something stupid with the sshd config, it won't be secure no matter what port it listens on.
 
Old 11-11-2004, 10:12 AM   #3
big_gie
Member
 
Registered: Oct 2003
Distribution: Redhat
Posts: 35

Original Poster
Rep: Reputation: 15
Hi,

thanks for the quick response.

Sorry if I sounded confusing with the 2 host things...

I'll explain a bit more...

2 computers are behind a router: so they have the same external ip. I need to ssh to both of them from a remote location. To distinguish the 2, I run them on different port. So to connect to the first I do:
ssh <external ip> -p 22
and for the second computer I do
ssh <external ip> -p 23
(22 and 23 are not the real ports)

but when I ssh using the first port, it adds a key to know_host. So when I try to connect to the second computer using another port but the same ip, ssh thinks that the host had changed its key...

I would like to add to know_host the key of both servers, witch are located at the same ip address but on different ports...

I hope it is more clear...

thanks
 
Old 11-11-2004, 11:41 AM   #4
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Have you tried connecting by hostname, rather than by IP? For example, you could add the following to the /etc/hosts file of your laptop:
Code:
111.222.333.444     WebServerHostname
111.222.333.444     DesktopHostname
replacing the 111.222.333.444 with your external IP, and WebServerHostname and DesktopHostname with the approriate hostnames.

Then use the commands:

ssh user@WebServerHostname -p 22
ssh user@DesktopHostname -p 23

to connect to the respective machines. This should identify the machines by their hostnames, rather than by IP, in your known_hosts file.

If this doesn't work, then you might consider only ssh'ing from outside the LAN into one of the machines, then ssh from that machine to the other, using it's internal IP.

Enjoy!
--- Cerbere
 
Old 11-15-2004, 04:12 PM   #5
big_gie
Member
 
Registered: Oct 2003
Distribution: Redhat
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for the response.

What I did was to install keychain to indentify with keys, and I now use putty to ssh. PuTTY will ask you the question if you want to update the fingerprint...

Thanks again
 
Old 11-15-2004, 08:55 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
You must be very, very careful how you approve updating the host keys because there are known exploits around for SSH session hijacking. There are even some utilities that will generate phoney host keys with the first few and last few octets that match. Unless you check every single octet against what you know is correct, you could be falling into a trap.
 
Old 11-16-2004, 11:28 AM   #7
big_gie
Member
 
Registered: Oct 2003
Distribution: Redhat
Posts: 35

Original Poster
Rep: Reputation: 15
Hum...

With your recomendation, I think I know what I'll do...

I have 2 dyndns.org hostnames. So I'll use them seperatly. I think I used only one of them for both computers, issuing the fingerprint question. Now I'll try to use unique hostname for both computers...

Thanks for the recommendation.
 
  


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
Multiple server support kranti Programming 1 10-27-2005 10:41 AM
Multiple names for the same SAMBA server Paul.Hermans Mandriva 0 07-29-2005 09:53 AM
Security idea - Server IDs bjdea1 Linux - Security 9 09-09-2004 05:50 PM
Stealth Firewall, IDS, and syslog server? OlRoy Linux - Security 8 11-08-2003 04:10 PM
Multiple X server... is it possible ? Ayden Linux - General 5 02-21-2002 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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