+Since MSYS2 doesn't support all the things a classic Sudo needs (setuid? PAM?), we need a replacement. One such replacement that doesn't seem to suffer from horrible security flaws is [*win-sudo*](https://github.com/imachug/win-sudo). It doesn't support (as of May 2020) the various different arguments (`-H`, `-u` etc.), but it does work in the most common use case of `sudo foo` running `foo` with elevated privileges. The authorization is handled by UAC, same as any other Windows program. But for those who chase for a more flawless alternative for sudo, there is also a universal sudo called [*gsudo*](https://github.com/gerardog/gsudo). Compared with win-sudo, gsudo is written in C# and can take effect on various shells like cmd, Powershell and shells in MSYS2. Have work on hand but forget to login your shell with privilege? Just run `gsudo` and your shell is elevated inheriting working directory. Not to mention gsudo support `-u` argument and can be installed with `winget`. If you feel typing `gsudo` is a bit long, you can do like `echo 'alias sudo=gsudo' > ~/.bashrc` to have a similar experience in GNU/LINUX.
0 commit comments