When I do a “sudo su -” on the command line from ssh, I get an error saying “sudo: argv[0] mismatch, expected “/bin/bash”, got “-bash””. I can still su to the root account, just not using the “-” option. Does anybody have any suggestions for how I can fix this?
I get the same error “sudo: argv[0] mismatch, expected “/bin/bash”, got “-bash”
Killed”. As far as I can tell both “sudo su -” and “sudo su -1” do the same thing so this is not surprising.
This does not invoke the signon scripts. “sudo su -i” or “sudo su -” does this. You can tell becuse the current directory changes. I have found that, “sudo -i” does most of the work of “sudo su -”; I will use that for now.
To save a few key strokes, so does just sudo su adding root isn’t needed.
Also, you shouldn’t need to specify - or -l the way TrueNAS is compiled anyway from what I’ve found. I’m not sure there’s any environmental variables of consequence. -l maybe generates an audit trail tho, it would show as a login of root.
Thanks @awalkerix for the reference. How do you explain that the issue starts only with 24.10, as they have the exact same sudo version (just did a shasum).
I don’t see anybody reporting it to Debian and couldn’t reproduce it any other bookworm.
was added. If removed everything works as before. If you don’t want to remove these lines you can add:
Defaults !intercept_verify
to fix the sudo su - bug
For me adding the !intercept_verify fixed my Ansible issues. And removing the 2 lines above fixed why I couldn’t run any command in lxc-attach anymore.
2 nights of fiddling to understand why my whole automation stopped working I didn’t know sudo could be configured to intercept commands. Interesting.