How do I become superuser on Ubuntu Linux using su/sudo?

http‮w//:s‬ww.lautturi.com
How do I become superuser on Ubuntu Linux using su/sudo?

To become the superuser (root) on Ubuntu Linux, you can use either the su or sudo command.

Using `su`

To become the superuser using `su`, you must first log in as a user with administrative privileges. Then, open a terminal and enter the following command:
su

You will be prompted for the password for the superuser account. Enter the password, and you will be logged in as the superuser.

To run a command as the superuser using su, you can use the -c option followed by the command you want to run. For example:

su -c "apt update"

This will update the package manager's list of available packages as the superuser.

Using `sudo`

To become the superuser using `sudo`, you must first log in as a user with administrative privileges. Then, open a terminal and enter the following command:
sudo -i

You will be prompted for your user password. Enter the password, and you will be logged in as the superuser.

To run a command as the superuser using sudo, you can simply precede the command with sudo. For example:

sudo apt update

This will update the package manager's list of available packages as the superuser.

Keep in mind that sudo is configured to allow certain users to run certain commands as the superuser. By default, users who are members of the sudo group are allowed to use sudo to run any command. You can configure sudo to allow or restrict access to specific users and commands by modifying the /etc/sudoers file.

Created Time:2017-10-16 14:38:44  Author:lautturi