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
  • 7 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 Create Sudo User on CentOS

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

Set Server Time Zones with Timedatectl

This article provides a guide to setting the server time and server time zone settings using...

508 Resource Limit is Reached

If your website is on a cPanel hosting account, you may have noticed the following error message:...

htaccess RewriteRule Examples

Here are some useful mod_rewrite RewriteRule redirect examples that you can use in your .htaccess...