Is there any other way to debug an app that run in privileged ports on Linux, than by attaching?
For now, I use commands like:
authbind --deep dotnet run --launch-profile "Development"
Then I use in Vscode, I select ".NET Core Attach".
But how can I launch vsdbg under authbind --deep for all my debug profiles?
I have never used authbind before. Does it show you the stdin/out of child process that it it launches? Will it stick around until the child process exits?
Also, Wikipedia lists another alternative to authbind: https://en.wikipedia.org/wiki/Authbind. Do you know if that will work for your scenario? I am assuming you would use the path to dotnet (ex: /usr/share/dotnet/dotnet) with it.
@gregg-miskelly
Does it show you the stdin/out of child process that it it launches? Will it stick around until the child process exits?
Well, if not done properly, everything will lead to "Permission denied", as ports <1024 need rights…
Anyway, it was late, and I did not try the only simple and right way (deep is very important here):
authbind --deep code
Now everything is OK.
And If you use setcap, know that each time the binary is updated, the rights are removed (set per binary).
Moreover, if you use "setcap CAP_NET_BIND_SERVICE+p /path/to/binary"
you have to deal manually with all dependency like:
"setcap CAP_NET_BIND_SERVICE+p /usr/share/dotnet/dotnet""setcap CAP_NET_BIND_SERVICE+p ./.vscode/extensions/ms-vscode.csharp-1.15.2/.debugger/vsdbg"and so one… (the 2 above are not sufficient). Without forgetting that at each update, the process need to be done again. And if an update add some dependency, you will have to update scripts, whereas with authbind, rights are set per user.
Most helpful comment
@gregg-miskelly
Well, if not done properly, everything will lead to "Permission denied", as ports <1024 need rights…
Anyway, it was late, and I did not try the only simple and right way (deep is very important here):
authbind --deep codeNow everything is OK.
And If you use setcap, know that each time the binary is updated, the rights are removed (set per binary).
Moreover, if you use
"setcap CAP_NET_BIND_SERVICE+p /path/to/binary"you have to deal manually with all dependency like:
"setcap CAP_NET_BIND_SERVICE+p /usr/share/dotnet/dotnet""setcap CAP_NET_BIND_SERVICE+p ./.vscode/extensions/ms-vscode.csharp-1.15.2/.debugger/vsdbg"and so one… (the 2 above are not sufficient). Without forgetting that at each update, the process need to be done again. And if an update add some dependency, you will have to update scripts, whereas with authbind, rights are set per user.