Ubuntu run command as root user on shell terminal

 

Ubuntu run command as root user on shell terminal

 

   On Ubuntu every times you need to run command as root user on shell terminal you may need to use sudo command to make sure that you can run command as root user without using sudo command.  To run command that can only execute by privileges user, the sudo command must be put in front of every command that run... that make very annoying when you need to execute many command that need that privileges.  The step by step example below show how you can make your terminal or keep your terminal run as root user and you dont have to put sudo command in every command that you want to execute.

 

Run as root user

 

1.  Open shell terminal.

Ubuntu open terminal

mike@computer-lab-02:~$

 

2.  From the Ubuntu terminal above, the screen show the dollar sign $.  The dollar sing usually appear on for the normal user.  To check user id on Ubuntu, execute id command or whoami command on the terminal as show on example below.

Ubuntu user id command

mike@computer-lab-02:~$ id

uid=1000(mike) gid=1000(mike) groups=4(adm),20(dialout),24(cdrom),46(plugdev),105(lpadmin),119(admin),122(sambashare),1000(mike)

mike@computer-lab-02:~$

 

3.  and execute whoami command to show your user login name

Ubuntu user name command

mike@computer-lab-02:~$ whoami

mike

mike@computer-lab-02:~$

 

sudo -i command

 

4.  To run command as root user on shell terminal (su root or sudo root) execute the sudo -i on the terminal as show on figure below... and key in your current user password

Ubuntu sudo -i command

mike@computer-lab-02:~$ sudo -i

[sudo] password for mike:

root@computer-lab-02:~#

 

5.  Now to verify that your ubuntu terminal become root terminal, execute id command and whoami  command again.

id command - to check root user id

root@computer-lab-02:~# id

uid=0(root) gid=0(root) groups=0(root)

root@computer-lab-02:~#

 

6.  whoami command - to check root user name

Check Ubuntu root user name

root@computer-lab-02:~# whoami

root

root@computer-lab-02:~#

 

Keywords: run command as root, sudo root user, sudo root, su root, root user shell ubuntu, ubuntu run command as root, ubuntu root user on shell terminal  

 



Thank you :)

Thank you :)