Ignore Sudo in a Shell Script If You're Running as Root

Published: 26 September 2023
on channel: Nick Janetakis
399
22

This can be useful to run commands as root outside and inside of Docker where sudo isn't available.

Hit the subscribe button to receive more videos like this!

REFERENCE LINKS
---------------------------------------------------
► https://nickjanetakis.com/blog/ignore...

COURSES
---------------------------------------------------
Courses I've created that focus on web dev and deployment topics.

► https://nickjanetakis.com/courses/

THE TOOLS I USE / GEAR
---------------------------------------------------
► https://nickjanetakis.com/blog/the-to...

FOLLOW ME ELSEWHERE
---------------------------------------------------
► Twitter:   / nickjanetakis  
► GitHub: https://github.com/nickjj

TIMESTAMPS
---------------------------------------------------
0:00 -- Intro
0:43 -- A use case
3:16 -- This could have been more straight forward
4:12 -- Overriding sudo in your script
5:53 -- UID vs EUID and USER
9:00 -- Using command and set to dynamically run commands as sudo
11:26 -- Confirming it works with Docker
12:34 -- The override approach is pretty neat
13:47 -- There's another way using SUDO_USER
15:56 -- Which method should you use?


Watch video Ignore Sudo in a Shell Script If You're Running as Root online without registration, duration hours minute second in high quality. This video was added by user Nick Janetakis 26 September 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 39 once and liked it 2 people.