[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Deleting lines in a file from configuration files with editfiles
From: |
Armin Wolfermann |
Subject: |
Re: Deleting lines in a file from configuration files with editfiles |
Date: |
Sun, 18 Dec 2005 01:01:21 +0100 |
User-agent: |
Mutt/1.5.10i |
* Jeremy Mates <jmates@sial.org> [16.12.2005 22:36]:
> Could you adjust the from="" statement and other SSH options based on
> class using editfiles?
The key fingerprint makes an excellent match criteria, e.g.
DeleteLinesContaining "AAAAB3NzaC1..."
AppendIfNoSuchLine "from=\"10.1.1.1\" ssh-rsa AAAAB3NzaC1..."
> How easily can you drop the same deployment SSH key into, say, all the
> "tomcat" group role accounts... do you have to duplicate the public
> key into the different editfiles blocks?
Define your keys in the control section:
control:
joe = ( "ssh-rsa AAAAB3NzaC1..." )
bob = ( "ssh-rsa AAAAB3NzaC1..." )
editfile:
{ /this/.ssh/authorized_keys
AutoCreate
Backup "off"
DeleteLinesContaining "$(joe)"
DeleteLinesContaining "$(bob)"
AppendIfNoSuchLine "$(joe)"
}
{ /that/.ssh/authorized_keys
AutoCreate
Backup "off"
DeleteLinesContaining "$(joe)"
DeleteLinesContaining "$(bob)"
AppendIfNoSuchLine "$(bob)"
}
Regards,
Armin Wolfermann