If a specific user can or cannot successfully execute a program (binary or script) depends on two things:
The user need execution privileges on the file.
This isn't a problem: ls -l
reveals that any user can execute /sbin/dhclient
.
The user needs reading, writing and/or execution privileges to the files the program accesses.
This part is much, much trickier and more dangerous, as it may involve changing the permissions of many files.
For more information, see Chmod - Wikipedia.
The normal way to execute a command with root privileges is sudo
. From the manpage:
sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. The real and effective uid and gid are set to match those of the target user as specified in the passwd file and the group vector is initialized based on the group file (unless the -P option was specified). If the invoking user is root or if the target user is the same as the invoking user, no password is required. Otherwise, sudo requires that users authenticate themselves with a password by default ( NOTE: in the default configuration this is the user's password, not the root password). Once a user has been authenticated, a time stamp is updated and the user may then use sudo without a password for a short period of time (5 minutes unless overridden in sudoers).
The basic syntax in your specific case is:
sudo dhclient
Regarding your other questions:
1. Where do all of the commands that do not require root privileges reside in my OS?
Most binaries for all users reside inside /bin
, /usr/bin
and /usr/local/bin
.
Most system binaries (require root privileges) reside in /sbin
.
This is just a rule of thumb. You can place binaries everywhere you want.
See also: Filesystem Hierarchy Standard
2. Can I move this command there?
Apart from potentially breaking something, this would have absolutely no effect.