Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied #138

Closed
vuh95 opened this issue Mar 28, 2024 · 5 comments
Closed

Permission denied #138

vuh95 opened this issue Mar 28, 2024 · 5 comments

Comments

@vuh95
Copy link

vuh95 commented Mar 28, 2024

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.

@KaeTuuN
Copy link

KaeTuuN commented Mar 28, 2024

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

@Nyr
Copy link
Owner

Nyr commented Mar 28, 2024

Thanks @KaeTuuN for the detailed explanation.

@Nyr Nyr closed this as completed Mar 28, 2024
@KaeTuuN
Copy link

KaeTuuN commented Mar 28, 2024

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

@Nyr
Copy link
Owner

Nyr commented Mar 28, 2024

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

@vuh95
Copy link
Author

vuh95 commented Mar 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants