- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ifconfig or "other" nic config command(s)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2011 12:06 PM
тАО02-07-2011 12:06 PM
Thx.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2011 12:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2011 12:18 PM
тАО02-07-2011 12:18 PM
Re: ifconfig or "other" nic config command(s)
For example, I can do 'ifconfig lan1' as a normal user to see how the NIC is set up.
However, if I do 'ifconfig lan1 up' as a normal user I get the "permission denied" error.
So, depending on what exactly you are trying to do, it may or may not check to see if you are root. If it is a function that could change a configuration or take the NIC up or down, the root would likely be required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2011 12:20 PM
тАО02-07-2011 12:20 PM
Re: ifconfig or "other" nic config command(s)
ifconfig lan0
works as any user, but
ifconfig lan0 up
only works as root.
So the command needs to be executable by any user, but you don't want any user being able to change IP addresses, so the code for ifconfig no doubt has a check for the effective user ID of the user in it, only allowing UID 0 to make changes...
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2011 08:59 PM
тАО02-07-2011 08:59 PM
Re: ifconfig or "other" nic config command(s)
In this case there is no need for that check since it isn't a setuid program. The standard permissions on the devices is what gives that error.
But ifconfig does call getuid(2) if only to give a nicer error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2011 01:56 AM
тАО02-08-2011 01:56 AM
Re: ifconfig or "other" nic config command(s)
Some system calls are restricted for privileged users only. When such a system call is made, the kernel checks the identity of the caller process. If the process does not have the necessary privileges, the kernel will immediately return a "permission denied" error code to the calling program instead of doing the requested action.
Originally, this restriction was solely based on whether the user is root or not. However, with RBAC, it's possible to assign some users the privilege to use some sub-set of the restricted system calls.
Before RBAC and similar fine-grained privilege systems, the original Unix way to allow some unprivileged user to use some privileged system call was to make a program that checks the user's identity, makes some independent checks as to whether this particular user is authorized to do the requested action or not, and acts accordingly. This program would then be given "setuid root" permission, to allow it to run the requested system call as root - if and only if the user passes the security checks built into the program itself.
A setuid root program has root privileges when it starts, but it still "knows" the identity of the user that started the program. For example, "passwd" is a setuid root program, but when it's used by a non-root user, it only allows the user to change his/her own password, not anybody else's. (For technical details, please read this: http://www.lst.de/~okir/blackhats/node23.html )
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2011 12:06 PM
тАО02-08-2011 12:06 PM
Re: ifconfig or "other" nic config command(s)
Adding to Matti's graceful explanation.. I'd like to add a part to the system calls... Sometimes, it is not enough to audit a command because as a malicious user someone would create a symobolic link between dir and ls and a dir * would be seen as a relatively safe command but is doing something very destructive. That is where the whole point arises of auditting the system call as in this way you get to know what dir actually does.
Regards
Ismail Azad