Echo to sudoers.d, instead of trying to edit the file