Everything You Need to Know About sudo | Linux Essentials Tutorial

  Рет қаралды 38,173

Akamai Developer

Akamai Developer

Күн бұрын

Sudo is a fundamental Linux command that allows a system administrator to delegate authority to give certain users, or groups of users, the ability to run commands as root or another user. In this video, we'll cover the basics of sudo and how it works.
Chapters:
0:00 Introduction
0:41 Why Do We Need sudo?
2:10 Check If sudo Is Installed
3:00 What Group is sudo In?
5:50 Which Permissions Can sudo Access?
6:30 Running apt update with sudo
7:00 Running sudo with the Previous Command
8:20 What is the /etc/sudoers file?
13:00 How to Properly Edit the sudoers File
18:20 Setup sudo Access Without a Password
19:20 A Quick Review
20:30 Including an Error On Purpose
23:15 Conclusion
New to Cloud Computing? Get started here with a $100 credit → www.linode.com/lp/youtube-vie...
Read the doc for more information on Linux users and groups → www.linode.com/docs/guides/li...
Learn more about Sysadmin basics → www.linode.com/docs/using-lin...
Subscribe to get notified of new episodes as they come out → kzbin.info?sub_co...
#Linode #AlternativeCloud #sudo #Linux
Product: Linode, Linux, sysadmin; Jay LaCroix;

Пікірлер: 54
@Ethorbit
@Ethorbit Жыл бұрын
Your tutorials are very appreciated; they are clear and well thought out so that every possible question is answered and there is no confusion leftover, with some side knowledge showing useful tricks (like !! enters the previous command, I did not know this!)
@JoelTalom
@JoelTalom 2 жыл бұрын
Just love the linux essentials series! Can't wait the next video
@kellypainter7625
@kellypainter7625 2 жыл бұрын
Nice! I just learned how to remove the password requirement in WSL. Thanks for your videos.
@runnerlinux1474
@runnerlinux1474 2 жыл бұрын
Thank you Teacher for all yr teaching... Everytime I got new thing to learn from u .. U are awesome ⭐
@ecotoser
@ecotoser 2 жыл бұрын
really enjoying these!
@behindthescene2727
@behindthescene2727 2 жыл бұрын
just gratitude to the makers n explainer
@moosehole646
@moosehole646 2 жыл бұрын
The leftmost picture behind your head is too high.
@RichardFreeberg
@RichardFreeberg Жыл бұрын
Many thanks. Nice instructional video!
@Jonathan-ru9zl
@Jonathan-ru9zl 2 жыл бұрын
Supremely good tutorial 👌
@KaiBuskirk
@KaiBuskirk Жыл бұрын
Super Cool! Thanks!
@PunitChoudhary
@PunitChoudhary Жыл бұрын
"sudo !!" It is going to help me a lot, thank you!!
@MarkVanderberg
@MarkVanderberg 2 жыл бұрын
Thank you for the video, I also just started reading "SUDO Mastery " by Michael W Lucas
@omfgbunder2008
@omfgbunder2008 2 жыл бұрын
His video on PAM is quite interesting. It seems like every distro does it wrong.
@jakspica
@jakspica Жыл бұрын
I am literally brand new to Linux so these videos have been helpful. on a completely unrelated note, I hope you fixed that multi-frame poster on the wall behind you...
@anirbanc88
@anirbanc88 2 жыл бұрын
you are a linux god man!!!!
@casabasari
@casabasari Жыл бұрын
Jay, maybe you can give me an advise. I have a bash script that will be executed by a no-root user , but in the script needs to run a chown command (root privilege) what is the safer way to do it?? should i add the user to the sudoers file with the privilege to run chown command? Its a good practice to have sudo command within a script?
@huyvole9724
@huyvole9724 2 ай бұрын
It's easy to understand with RunAs and selected CmdLines. Can you give an example of "host restriction"? It's so obscure that it's almost impossible to imagine the usefulness that this function brings.
@anandrai9531
@anandrai9531 2 жыл бұрын
Hi Jay your video is very informative , thanks for all info, can you make video o rbash and rbash is how different from this sudoers configured command in sudoers file , thank you
@TechieZeddie
@TechieZeddie 2 жыл бұрын
Thanks for showing us the finer settings on sudo. Since we can restrict a user to elevate apt, is there anyway to restrict the user to only use "apt update" and "apt upgrade"? In other words, restrict not only the program but specific sytanx. This would allow a user to only update and upgrade but not install new packages.
@BleuSquid
@BleuSquid 2 жыл бұрын
You can, but you probably shouldn't. A better option would be to make a wrapper script to run with the specific arguments you want, and then add a sudo rule to allow that script. With regards to apt specifically, I'd be very nervous letting someone upgrade packages if they can't also install/remove packages or run dpkg if needed to fix things if an upgrade goes wrong or causes some sort of breakage.
@omfgbunder2008
@omfgbunder2008 2 жыл бұрын
The commands in sudoers can be either the command, or the command and specific arguments
@unbekannter_Nutzer
@unbekannter_Nutzer Жыл бұрын
@@omfgbunder2008 Do they need special syntax, then, or is the absence of a comma enough?
@minecraftchest1
@minecraftchest1 2 жыл бұрын
If you type h or help when visudo gives you an error, then it will give you the options available.
@themistoclesnelson2163
@themistoclesnelson2163 Жыл бұрын
Thanks
@joojay328
@joojay328 Ай бұрын
great video and overview.
@farjanaorniojanta8348
@farjanaorniojanta8348 2 жыл бұрын
Gd tutireal
@Chalisque
@Chalisque 2 жыл бұрын
One thing to be aware of. If you put something in /etc/sudoers or /etc/sudoers.d and it contains an error, sudo will refuse to run, and you need root permissions to edit /etc/sudoers and /etc/sudoers.d. This can be quite a conundrum if you don't, as is the default, have a password on the root account. (I learned, from this, that you should use sudo -s to get a root shell to manipulate /etc/sudoers, and then su back to a user account and sudo echo hello just to check sudo is working fine before closing the root shell.)
@minecraftchest1
@minecraftchest1 2 жыл бұрын
I found that it is possible to work around broken sudo and no root password using polkit.
@simonbaxter8001
@simonbaxter8001 2 жыл бұрын
Great video. My OCD can't stop looking at that left hand picture on your wall though .. it's not aligned!!!
@kennethjakobsen7295
@kennethjakobsen7295 9 ай бұрын
I really love the part, of giving partial root access.
@MarkVanderberg
@MarkVanderberg 2 жыл бұрын
I have been playing around with Linode last couple of months and I think it would be useful to have a post-install script I would set up a few things on a new server install. By creating a new user on the server and making them part of the SUDO group, Removing root login, Doing upgrades and updates and activating automatic updates, installing some programs that are not installed by default, removing the capability of logging with password and of course before that loading your RSA keys. And I like my prompt certain way so I would like to add that to the script. Maybe sometime you could do a video on such a script?
@Chris-rm1pn
@Chris-rm1pn 2 жыл бұрын
You probably should look into ansible, Jay has a whole video series about it on his channel.
@MarkVanderberg
@MarkVanderberg 2 жыл бұрын
@@Chris-rm1pn That looks way more involved than what I need. I just need a simple script, I'm just playing it's nothing super important.
@omfgbunder2008
@omfgbunder2008 2 жыл бұрын
I haven't checked my linode but I know DO can do this (although I've never used it)
@Rbourk252
@Rbourk252 2 жыл бұрын
It ALL good
@Jerraf2p0
@Jerraf2p0 Жыл бұрын
23:17 YES. IT WAS
@hoterychannel
@hoterychannel 2 жыл бұрын
What the best/correct way to login as root or another user?
@darrinswanson
@darrinswanson 2 жыл бұрын
Can you have multiple lines for a user which will give sudo access to some commands with password verification and other commands bypassing the need for password verification?
@nathanaelries9783
@nathanaelries9783 Жыл бұрын
Not multiple lines, but you can comma delimitate each command you would want the password to be bypassed for. ALL=NOPASSWD:/bin/path_to_command1,/bin/path_to_command2
@kakyoin4535
@kakyoin4535 Жыл бұрын
thanks babe
@tubeDude48
@tubeDude48 Жыл бұрын
At 13:28, short this does not work with a Pi. For the Pi, it's: sudo nano /etc/sudoers
@user-ch2ix9su8g
@user-ch2ix9su8g Жыл бұрын
Please what does sudo bash do?
@hoterychannel
@hoterychannel 2 жыл бұрын
Interesting thing with sudoedit is it don't know some settings (at least version on debian 10) and show warning when file are 100% correct, so it can lead to skip and save file with actual mistake
@unbekannter_Nutzer
@unbekannter_Nutzer Жыл бұрын
A concrete example would be nice.
@guilherme5094
@guilherme5094 2 жыл бұрын
👍
@aleksandrasg.9885
@aleksandrasg.9885 2 ай бұрын
How do I log in back
@jprathap8393
@jprathap8393 Жыл бұрын
Why we need to put sudo for tux user when it is configured just like root .
@unbekannter_Nutzer
@unbekannter_Nutzer Жыл бұрын
Just for demonstration purpose, and in case something goes wrong, the root account is not affected, I guess.
@peerullahhussainy7610
@peerullahhussainy7610 Жыл бұрын
Excellence 🎉giveaway thanks 😊
@serakshiferaw
@serakshiferaw 5 ай бұрын
q on visudo is just wrong. it should be something like wq! , i will assume q is just quit
@nbensa
@nbensa 2 жыл бұрын
What a bad decision made by the sudo developers to use 'q' to save a wrong sudoers file. 'q' is actually what you would type to exit without saving. 'W' (uppercase) seems like a better option in my opinion.
@saintpou5418
@saintpou5418 Жыл бұрын
YOU SHOULD NEVER USE "Q"!!
@mdridoy8379
@mdridoy8379 2 жыл бұрын
👍
The htop Command | Linux Essentials Tutorial
13:44
Akamai Developer
Рет қаралды 30 М.
Linux Crash Course - sudo
26:11
Learn Linux TV
Рет қаралды 62 М.
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 35 МЛН
Китайка и Пчелка 10 серия😂😆
00:19
KITAYKA
Рет қаралды 2 МЛН
The delivery rescued them
00:52
Mamasoboliha
Рет қаралды 10 МЛН
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,2 МЛН
How to use chmod | Manage File Permissions in Linux
15:52
Akamai Developer
Рет қаралды 51 М.
Linux Security - Configuring SUDO Access
19:10
HackerSploit
Рет қаралды 44 М.
Linux Crash Course - systemd: Using the systemctl command
26:32
Learn Linux TV
Рет қаралды 95 М.
Why "sudo" when you can just "su"?
10:39
DistroTube
Рет қаралды 29 М.
SSH Full Course - EVERYTHING You Need to Know!
1:28:00
Learn Linux TV
Рет қаралды 561 М.
sudo and su | Into the Terminal 12
35:51
Red Hat Enterprise Linux
Рет қаралды 813
60 Linux Commands you NEED to know (in 10 minutes)
10:50
NetworkChuck
Рет қаралды 1,3 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,5 МЛН
Интереснее чем Apple Store - шоурум BigGeek
0:42
Best Beast Sounds Handsfree For Multi Phone
0:42
MUN HD
Рет қаралды 341 М.