Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 371  / 2 Years ago, fri, december 17, 2021, 11:58:15

I'm a little concerned about the existance of ifconfig command in /sbin directory. enter image description here



I don't really understand the main purpose of /sbin directory and the lack of the root privilege of those commands in that directory.



For example,



xxxx@Jacks:~$ l -l /sbin/ | grep shut
lrwxrwxrwx 1 root root 14 Feb 6 19:00 shutdown -> /bin/systemctl*


shutdown command/utility is shown as link to the /bin directory, that seems pretty normal.



If /sbin a system (root) directory, why is a normal user(without super user privileges) able to execute ifconfig command?


More From » 18.04

 Answers
6

If /sbin a system (root) directory, why is a normal user(without super user privileges) able to execute ifconfig command?




The above statement can only be fully answered by the creators of the OS that ifconfig command is found on. But let share this, there are certain tools that need to do tasks that normally only the root user should do but every normal user aught to be able based on the fact that these tasks are needed by every user. An example would be the passwd tool, it is found on my system in the /usr/bin/ directory but users would normally need to run sudo to use any tool in that location but here I can use just passwd to change my password and only my password. So that tool is designed to be used by anyone but when run it runs with what is called the privileges of the effective user which is root.



Now that's the theory behind such tools, which ones get to be designed this way is up to the creators of Ubuntu or any other linux OS for that matter, any tool can be made to behave like this and in this case ifconfig is falls into this category.



Simpy put I don't have to be root to use the passwd to change my own password but will have to be to change the password of every other user of the system. So Ubuntu developers can later decide that you need to be root to use ifconfig and that will change the way it is used or accessed.



And for the fact that it is located in that location simply means it is a tool that the system requires access to and that's the normal location for such tools.


[#3596] Saturday, December 18, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brailloni

Total Points: 122
Total Questions: 108
Total Answers: 108

Location: North Korea
Member since Tue, Apr 4, 2023
1 Year ago
brailloni questions
Tue, Jun 21, 22, 21:51, 2 Years ago
Thu, Jul 29, 21, 05:25, 3 Years ago
Sat, Apr 2, 22, 17:32, 2 Years ago
Mon, Oct 31, 22, 21:39, 2 Years ago
;