On 02/11/2014 01:10 AM, Zenaan Harkness wrote: >> On Feb 10, 2014 2:53 PM, "Zenaan Harkness" <z...@freedbms.net> wrote: >>> With a dyndns type server, each time a new ip address happens, ssh >>> login adds a new entry to .known_hosts >>> >>> Is there a recommended way to handle this? > > On 2/11/14, Schlacta, Christ <aarc...@aarcane.org> wrote: >> Configure static dhcp leases for your server systems. Every dhcp daemon had >> a configuration entry for this. > > Thank you for the suggestion, however it's the "public" side that's > the problem - I do have the server set up (internally) with static > config. > > The publicly visible IP changes every so often, using a dynamic dns > service. Accessing the server from this public domain name obviously > results in a new IP address every now and then. > > I'm wondering: > > 1) how to easily clean known_hosts > 2) is there some configuration to automate/simplify this > > PS Please reply to the list in general, unless it really is a personal > email - I just made the same mistake, although there was no debian > address to reply to :) > > One way might be to paste the key into sed and use //d to delete the lines with the key. Since / can occur in a key, # is used here as the delimiter:
sed '\#AAAAB3NzaC1yc2EAAAADAQABAAABAQDK...#d' ~/.ssh/known_hosts If that does what you want then add -i Regards, /Lars -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/52f9d0be.1090...@gmail.com