Learning is inevitable right, on that note I'm starting the after , moving on to the next one. Linux file system An Introduction to Linux and Terminal Basics Sudo and root access Everything we see on Linux is a file, the Linux operating system is just a grouping of files. Every command we run tells the files to group them to complete the work. Now I'm a user I live inside the home directory of the root directory. cd / - switch to root directory here in this case listing users. ls /home/ - listing the files in the home directory Now every process or command I run, it'll always run as me being the owner of that process. It does not require any permission for accessing the directories which reside in the user directory but what if I need to run a command which accesses packages from or install new packages? /home/USERNAME / - root directory These tasks seem out of hand for working with limited directories and permission. USER Let's see if that's true: Now I can't just change it into the root directory and try running it, it doesn't work like that, when we open up our terminal we see ourselves in the home directory as a user by default. It means that I am responsible for the directories/files/applications that reside home directory, what's the catch here? why so? Why it doesn't work and need ? special permissions Because the changes made by the / are applied to the system as a whole irrespective of the user. root user super user What is root access? The root user also known as a superuser or The Administrator is the most powerful user of all the users in the system. Even if there's only one human user in the system there are more users in the system itself like system daemons and more, you can know more about it using the command sudo cat /etc/passwd is the file that contains data about all the users in the system. /etc/passwd The whole system files, packages, and applications come under the root, having root privileges means that one has complete control over the system, every Linux system has its own root user and there's only one. As it is said Linux system is nothing but a group of files it is decided when the root permissions are needed and when not. To view the permissions to a file or directories you can use the command which stands for ll long list The image shown above lists the permissions of the applications, files, and packages of the root directory, it is the highest directory of all, every other directory comes under the root directory even the user directory as well - for the user's home directory. cd - for the previous directory from the present directory cd .. for the previous working directory cd - Try command from the user's home directory and see where it leads to. cd ../.. Hope the image above explains why running commands as a root doesn't require permissions What is sudo? To get permission to perform the tasks of an administrator as a user we need to use the keyword as a prefix before the command, it stands for which again says that doing tasks as a root user. sudo superuser do While you're working on a project or setting up a new environment for an application or trying a new tool, prefix is necessary to install new software, application, or tools, you may have to use it multiple times over a period of time so it's better to switch to a temporary root session using the command which stands for sudo sudo su superuser do switch user The terminal switches to a new shell session to run commands as the root user therefore we don't have to use multiple times sudo is the command to start a new shell for a temporary root session where the environment and path variables will the set to the root directory as if the root user has logged into the terminal. sudo su - exit or ctrl + d - To exit the shell and are two different command operations, I can run the command without the prefix but it still asks for a password which is the root password and each time I run the command it asks for a password whereas the has a time limit of 15 minutes(it can be increased but not recommended) each time I run it, It doesn't ask for a password when is used in that time frame. sudo su su sudo su sudo sudo I can also extend the time limit by using the command for that particular session and to reset the time stamp. sudo -v sudo -k I can always know more about the flags and the commands by using man command_name , are the commands(recommended) that work the same as the and command sudo -s sudo -i sudo su sudo su - command asks for the root password and it's disabled by default when I installed Ubuntu and started using it, I had to set the password for the root but what if I run the command before, then I cannot run it I need to set the password. su su But it's always better to let the user use the prefix to log into the root shell, and we can permit who can use it while working in groups the admin can control that task so that the system administrator doesn't have to share the root password sudo A system administrator also can handle the access of using prefix to members of the group on who can use it and who cannot. sudo Logging as root only works on a terminal and I'm still not allowed to log in as root in the graphical interface. Change password To change the password of the user or even the root user the command is , prefix not needed if you logged in as a root user sudo passwd USERNAME sudo Running the command with no arguments provided changes the password of the root Here are handy keyboard shortcuts for Ubuntu Desktop: https://twitter.com/jksrtwt/status/1551131265918574593 Hope you got a good idea about sudo and root access. Happy learning buddy.