zsh: command not found: sudo
How do I solve this problem and use sudo under FreeBSD 9.x system?
|Estimated completion time||N/A|
Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. Unlike su, sudo authenticates users against their own password rather than that of the target user. Sudo allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments. This allow the delegation of specific commands to specific users on specific hosts without sharing passwords among them.
Install sudo using FreeBSD port system
To install the port, enter:
# cd /usr/ports/security/sudo/ && make install clean
Install sudo using pkg_add comamnd
To add the binary package, run
# pkg_add -rv sudo
# pkg_add -r sudo
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/sudo.tbz... Done.
How do I configure sudo?
The default configuration file is located at /usr/local/etc/sudoers. This file MUST be edited with the visudo command as root. Failure to use visudo may result in syntax or file permission errors that prevent sudo from running.
% su -
Allow user vivek to run all admin tasks via sudo:
vivek ALL=(ALL) ALL
Allow members of group wheel to execute any command:
%wheel ALL=(ALL) ALL
Save and close the file.
Task: Become a root user with sudo
Type the following command
% sudo -s
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. Password: <Enter Your Own Password Here> fdbsd9#
Task: Run any command as root
The syntax is:
sudo /path/to/command sudo /path/to/command arg1
In this example, restart ftpd service:
% sudo /etc/rc.d/ftpd restart
Password: <Enter Your Own Password Here> Stopping ftpd. Starting ftpd.
See alsoTweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?
- 30 Cool Open Source Software I Discovered in 2013
- 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