From the course: Linux for PHP Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Administration commands with sudo

Administration commands with sudo

From the course: Linux for PHP Developers

Start my 1-month free trial

Administration commands with sudo

- [Instructor] Sometimes we'll need to perform administrative tasks that the current user doesn't have permission to do. The sudo command is used to run programs with the security privileges of another user. By default, this user is root. The name sudo is the combination of the su command, which allows you to use the shell of another user, and do, which isn't a command, it just means to take action. Think of sudo like trying to access the backstage of a concert. If you just try to walk in, the bouncer won't let you pass. However, if you use sudo and you say your password, he'll let you in. Let's see sudo in action by trying to access a file that we don't have permission for. There's a special file that contains one way encrypted passwords for all users. First, let's do a directory listing, ls -la, then the full path, which is /etc/shadow. The third column shows the owner of the file, which is root. And the fourth shows the group that the owner is in, which is shadow. My username is…

Contents