Nyr / wireguard-install

WireGuard road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Permission denied

vuh95 opened this issue · comments

Hello.

I am trying to use this script to install a Wire Guard on a Ubuntu Oracle instance, and I am getting this issue.

image

Can anyone help me resolve this issue?
Thank you.

You do not need to run wget as root (You should never do that) but instead run bash as root.

Wrong: sudo wget [...] && bash [...]
Correct: wget [...] && sudo bash [...]

Further Explanation:
You run two separate commands and concat them with && so sudo is not used for the whole line, but only for next command. Your && does run the right command only if the left command returns 0 or true.
More Explanation: https://stackoverflow.com/questions/4510640/what-is-the-purpose-of-in-a-shell-command

commented

Thanks @KaeTuuN for the detailed explanation.

@Nyr Maybe you could add sudo to the Install string in README.md?

commented

No, as it depends on the particular environment. Plenty of VPS providers provide root accounts by default.

You do not need to run wget as root (You should never do that) but instead run bash as root.

Wrong: sudo wget [...] && bash [...] Correct: wget [...] && sudo bash [...]

Further Explanation: You run two separate commands and concat them with && so sudo is not used for the whole line, but only for next command. Your && does run the right command only if the left command returns 0 or true. More Explanation: https://stackoverflow.com/questions/4510640/what-is-the-purpose-of-in-a-shell-command

Thank you so much for your kind response.
I can run the script now.