On Tue, Oct 21, 2003 at 07:52:35PM -0600, Ross Werner wrote: > Hey all, > > Let's say box Q is visible to the Internet, acting as a firewall, and port > forwarding various ports to a dozen boxes behind a firewall. Hence if I > > ssh -p 8001 Q > I get firewalled box one, > ssh -p 8002 Q > I get firewalled box two, > ssh -p 8003 Q > I get firewalled box three, > > and so forth. Unfortunately, ssh remembers what the RSA key was for my > last session with Q, and keeps giving me all these "IT IS POSSIBLE THAT > SOMEONE IS DOING SOMETHING NASTY!" errors, forcing me to go in and delete > the key out of ~/.ssh/known_hosts. > > My question is: is there a way to store multiple keys in > ~/.ssh/known_hosts, so that ssh won't whine at me every time I want to > connect to a different host through a different port on the same machine > Q? >
This is not an exact answer to your question, but it should be a
reasonable workaround.
1) Add an entry to /etc/hosts for each box. For example if the ip for Q
was 192.168.1.1:
192.168.1.1 Q one two three
2) Add an entry to .ssh/config for each box:
Host one
Port 8001
Host two
Port 8002
Host three
Port 8003
3) You can then ssh to one, two, and three like this:
ssh one -l uname
ssh two -l uname
ssh three -l uname
4) You will have a separate entry for each box in your .ssh/known_hosts
--
--------------------------------+-----------------------------------
Byron Clark | http://www.byronandannie.net
[EMAIL PROTECTED] |
--------------------------------+-----------------------------------
GnuPG Fingerprint: 0365 6979 6C3E BC0C 56C0 FB7F 12B3 75DD 042B EA68
pgp00000.pgp
Description: PGP signature
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
