Hello I am looking for assistance searching /root/.ssh/authorized_keys for a given public key (call it $pub_key) and removing it. Want to do this in bash script.
What's the best way to accomplish this?
|
|
|
Would |
|||||||
|
|
Never forget the power of perl oneliners!
That will perform an in-place edit and remove the offending key. Or, perhaps you have a really really long authorized_keys file and you want to process it in parallel with gnu parallel?
the possibilities are endless. update: fixed typo that Ole pointed out. Thanks Ole! |
|||||
|
Remove the space before
|
|||||
|