Maintaining SSH Host Keys Across a Large Network?
skullY asks: "Like most organizations, we have a large number of servers, all of which have unique host keys. Our big problem right now is that the vast majority of our servers are in a cluster and we have one or two machines that get reinstalled every week. Every time this happens, a new SSH host key is generated, and all our existing machines bitch when they have to connect. I realize that the best approach is to install system wide ssh_known_hosts files, and keep them up to date, but in practice this isn't so easy. So my question is how does everyone else keep track of large numbers of SSH host keys that continually change, and propogate those changes to machines on the network?"
When I was able to do my own spam-armoring, you got a chance to email me. Now you can only hope I see your reply.
use gnu queue for this. it can do all that and more.
What about setting up an NIS map for the known_hosts file?
Support The GNU Project!! http://www.gnu.org
Our big problem right now is that the vast majority of our servers are in a cluster and we have one or two machines that get reinstalled every week.
:)
You just answered your own question, stop reinstalling everything every week, for Christ's sake
You're tired of Slashdot ads? Get junkbuster now!
What is the point of backing up keyfiles to tape or to another host.
Some '3733t h4x0r' just needs to steal the tape or compromise the server where the keys are contained and every advantage of ssh keys is eliminated. Backup tapes violate file permissions at a distance. A single point where all keyfiles are stored is a boon to internal hackers.
Conformity is the jailer of freedom and enemy of growth. -JFK
You have a point, but think about practical considerations too.
In a university or colocation facility, yes you NEED to be running ssh or pptp or something similar.
But what do you gain in the datacenter or other internal corporate enviroment? If your professional staff is going to break your machines, they'll be able to even with ssh present.
Where I work, we have a cluster of IBM RS/6000 machines, a couple dozen Suns and a bunch of Digital AlphaServers doing a wide variety of data processing. We do not use ssh at all for a couple of reasons.
1. 90% of servers have 6 or less users, who are admins or senior dba's/developers. Most connectivity is done through client/server connections to databases or other applications.
2. Most end-user types cannot even directly connect to the server subnets. All connections go through a broker of some sort.
3. It's a pretty new network. Everything is switched. Hard to sniff on a switch.
What would ssh gain us in this circumstance? Nothing, but wasting a few more CPU cycles.
Conformity is the jailer of freedom and enemy of growth. -JFK
If this is an internal enviroment, using ssh in this manner is probaly a waste of time and processor resources. Firewalls and private networks are the best way to secure servers in an enterprise enviroment.
I mainly work with database servers, which all sit in protected subnets, accessible only to the application servers (brokers, report writers, etc) which need direct access to the database.
If any application is overhyped on Slashdot, ssh is. Clueless sysadmins writing passwords on notepads and stacks of DLT tapes on sysadmin's desks are a far bigger security menace than hackers sniffing an internal network for passwords.
Conformity is the jailer of freedom and enemy of growth. -JFK
You're assuming that he allows root SSH logins :)
Kerberos provides security in various different ways, including authentication, authorization, and encryption. A kerberized telnet is arguable just as secure as ssh (perhaps more so).
sigs are a waste of space
When I used ktelnet years ago, it only encrypted the authentication sequence. Everything else, including typing su, as in the clear. Don't know if this is still the case....
I belive this depends on the implementation of ktelnet you have, but a fully compliant kerberos application can use the kerberos service to support both authentication and encryption.
sigs are a waste of space
You're using the wrong technology for the problem. SSH is great for connecting to the occasional remote host (e.g., to your ISP shell account, to your office computer from home and vice versa), but it was never designed to handle this type of situation.
In this case you really should be using a central authentication method. Kerberos is one well-known example, and there are others as well. In this case you would/could still generate new host keys, but you would only have to update a single server (two, including a backup server).
The flip side of this problem is that you really don't want to allow just anyone to connect to a server cluster - with SSH you can specify acceptable user keys, but it's even more of a nightmare to propogate this information to each system. With a central server, you can disable a user's account systemwide (or on some defined subnet) with a single update. No worries that the guy who had to be fired left a backdoor SSH keyfile on a server or three.
Conversion to Kerberos isn't trivial, but it has some additional benefits. E.g., SSH just gives you communications, but Kerberos authentication is also available to properly configured applications (ktelnet, kftp, ksu, plus sudo, cvs, postgres, lprng, pop/imap, etc. Even NFS, on some non-Linux systems.) I've found a Kerberized system *easier* to use because I'm rarely asked for passwords except when logging in, or asking for root privileges. No need to keep track of separate passwords, lest someone trivially break the CVS password and figure out my account's password.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
What's so hard about backing up your data files before you do a reinstall? OpenSSH likes to install them on /usr/local/etc/ssh_host_key, /usr/local/etc/ssh_host_dsa_key, /usr/local/etc/ssh_host_rsa_key, /usr/local/etc/ssh_host_key.pub, /usr/local/etc/ssh_host_dsa_key.pub, and /usr/local/etc/ssh_host_rsa_key.pub. If you back these up before you wipe things and put them back when you're done it's all better. You won't have these problems anymore. Some linux distros might want to put them in /etc rather than in /usr/local/etc, but nonetheless you just need to make backups of unreplaceable data before you do wiping the drives. It's just not that hard.
_____________
I don't want free as in beer. I just want free beer.
The root problem here is that when you reinstall machines you aren't restoring the original ssh host keys. Why don't you start making backups of those keys and restoring them to the proper places whenever you do a reinstall?
Secondly for key distribution why don't you setup a cronjob that will copy the host key list from a single, secure, server every hour or something via scp? Then just make sure that servers host key never changes by doing the above.
Or make a script along the lines of:
for i in host1 host2 host3
ssh root@$i "scp someserver:/keyslist keyslist"
end
and run it every time you need to update all of the key lists.
All those methods are quite secure as they all use scp to do the copying and will fail should the host key of the machine somehow change, say by an imposter. Unless someone manages to break into the machine itself your fine.