gvm icon indicating copy to clipboard operation
gvm copied to clipboard

How to use Go, GVM from a sudo context?

Open mcandre opened this issue 5 years ago • 3 comments

Sometimes I need to run Go command line tools from a privileged environment. However, gvm is trickier to use with sudo. The best I've found so far is:

$ sudo -E bash
$ <go, gvm, or custom go tool here...>
$ exit
$

However, it would be more convenient to have a one-line syntax for this kind of command call. Any tips?

I tried sudo -E tonixxx clean boil and sudo -E bash -c 'tonixxx clean boil' but strangely they were not able to receive my full environment, so bash was not able to find my tonixxx binary like it can in a normal user shell. I am loading gvm from direnv, in case that matters.

mcandre avatar Jun 29 '19 23:06 mcandre

Are there updates here? I have the same problem.

hosembafer avatar Apr 26 '21 17:04 hosembafer

I don't know whether this can answer, can't sudo $(which gvm) handle this?

ffrmns avatar Dec 27 '21 14:12 ffrmns

Same problem, is there any intention to fix this?

ahmadateya avatar Jul 11 '22 13:07 ahmadateya