How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server.

From the command line, login as root user.

Switch to the sudo user.

# su - username

To use sudo, simply prefix the command with sudo and a space.

# sudo [COMMAND]

For example, to list the contents of the /root directory you would use:

# sudo ls -l /root

The first time you use sudo from this account, you will see the following banner message and you will be prompted to enter the password for the user account.

We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for username:

READ ALSO: How to Create Sudo User on CentOS

  • sudo
  • 6 Users Found This Useful
Was this answer helpful?

Related Articles

 View Server PHP Environment with phpinfo.php

The phpinfo() function outputs a huge amount of information about the system you're using, such...

 How to Change Root Password Using SSH

This article explains the method of changing the root password on a Linux Server using SSH....

 How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

 Import SSH Keys on CentOS 7 Server

This article provides a guide for importing SSH keys to CentOS 7 VPS server or Dedicated Server....

 Disable SELinux in CentOS 7

This article will provide the steps to disable SELinux in CentOS 7. SELinux is a security...

Powered by WHMCompleteSolution