I'm typing the following command:
But, getting the error:
How do I fix this problem under Debian / Ubuntu / RHEL / CentOS Linux?
This error means the sudo command is not installed. The sudo command allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file.
Step #1: Become a root user
Use su - command as follows:
$ su -
When prompted you need to type the root user's password.
Step #2: Install sudo tool under Linux
If you are using Debian or Ubuntu Linux, enter:
# apt-get install sudo
Sample outputs:
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: sudo 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 610 kB of archives. After this operation, 983 kB of additional disk space will be used. Get:1 http://security.debian.org/ squeeze/updates/main sudo amd64 1.7.4p4-2.squeeze.3 [610 kB] Fetched 610 kB in 4s (132 kB/s) Selecting previously deselected package sudo. (Reading database ... 30838 files and directories currently installed.) Unpacking sudo (from .../sudo_1.7.4p4-2.squeeze.3_amd64.deb) ... Processing triggers for man-db ... Setting up sudo (1.7.4p4-2.squeeze.3) ... No /etc/sudoers found... creating one for you.
If you are using RHEL / CentOS / Fedora / Scientific Linux, enter:
# yum install sudo
Sample outputs:
Loaded plugins: product-id, protectbase, rhnplugin, subscription-manager Updating certificate-based repositories. Unable to read consumer identity 0 packages excluded due to repository protections Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package sudo.x86_64 0:1.7.4p5-12.el6_3 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Installing: sudo x86_64 1.7.4p5-12.el6_3 rhel-x86_64-server-6 423 k Transaction Summary ==================================================================================================== Install 1 Package(s) Total download size: 423 k Installed size: 0 Is this ok [y/N]: y Downloading Packages: sudo-1.7.4p5-12.el6_3.x86_64.rpm | 423 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : sudo-1.7.4p5-12.el6_3.x86_64 1/1 Installed products updated. Verifying : sudo-1.7.4p5-12.el6_3.x86_64 1/1 Installed: sudo.x86_64 0:1.7.4p5-12.el6_3 Complete!
Step #3: Add admin user to /etc/sudoers
You need to add yourself to /etc/sudoers file, enter:
# visudo
Grant vivek user full permission via sudo:
vivek ALL=(ALL) ALL
Save and close the file.
How do I use sudo?
To become a root user and start root shell, enter:
$ sudo -i
OR
$ sudo -s
To run a command called '/sbin/service httpd restart', enter:
$ sudo /sbin/service httpd restart
To reload squid proxy server, enter:
$ sudo /usr/sbin/squid3 -k reconfigure
Sample outputs:
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 vivek:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 0 comments… add one now }