Enter the command:
ifconfig
as root, and you’ll see your IP address (among other things). Just to be sure, run:
whoami
And while you’re at it, check your (root’s) group memberships:
groups
Now leave root:
logout
At the login prompt, log in as studenth:
login: studenth
password: student
Now compare studenth’s characteristics
Type the commands:
ifconfig
whoami
groups
What do you get?
You’re currently logged in as studenth.
Your default permissions and environment are MUCH more restrictive than root’s.
And your PATH is different.
Enter the command:
whereis ifconfig
What do you get?
ifconfig won’t run directly for studenth because the command (actually, the program run by the command) isn’t in the PATH of studenth.
ifconfig WILL run if you specify its location:
/sbin/ifconfig
Still logged in as studenth, first find the useradd command (program):
whereis useradd
Now type the command using its full path.
Explain what you get.
Make sure you correctly called the command from its real location.
studenth was not CREATED as a root-group user.
studenth does NOT have the same rights as root.
Now we’re going to add to studenth’s PATH environment variable:
set PATH=${PATH}:/sbin
Check the result using echo:
echo $PATH
Run this command:
ifconfig