Every time I execute a command with sudo
, a file called .sudo_as_admin_successful
is created in my home directory. As far as I can tell, this exists for the sole purpose of disabling this message that bash prints on startup:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
It's possible to stop that message by commenting out the relevant section in /etc/bash.bashrc
, but sudo
still creates an annoying file in my home directory.
This webpage suggests that you can stop the file being created by removing yourself from the admin
group, but I'm not in any such group, and admin
isn't in /etc/group
.
Is there a way to stop this file being created?
I believe this is not a duplicate of this question, as that was asking if it was possible to make the notice printed by bash go away, rather than if it's possible to stop the file being created by sudo
.
Based on the following section of the
plugins/sudoers/sudoers.c
source code file, it doesn't look like it's possible without recompilingsudo
, undefining theUSE_ADMIN_FLAG
pre-processor macro.Also, note that it's checking for group membership of both
admin
andsudo
. I haven't checked the changelog, but I suspect the latter check was added whensudo
became the default group for privileged users - perhaps the filename still refers toadmin
for compatibility.It looks like this issue is being dealt with right now: https://github.com/sudo-project/sudo/issues/56