April 6th, 2002, 06:02 AM
Network programming with Libnet and permissions.
I'm starting to program using Libnet in my Linux system (RH 7.2). I can only initialize the network if looged as root. Is it compulsory or I can change some permissions to be able to do it as a regular user? I have an ethernet card.
April 20th, 2002, 10:15 AM
you can make the specific program suid-root.
chown root.root <program>
chmod 4777 <program>
then you can start it as user but it will run with root permissions.
April 22nd, 2002, 09:56 AM
Thank you. More questions.
Thanks for your reply. I should have imagined...
Is there a way to do it so you do not have to give root owness to the program? I mean, something like giving acces to write into the ethernet to some users different from root? I don't know if it's completely dumb or there is a way to do it. I'm not a Linux pro :-(.
April 22nd, 2002, 01:26 PM
no, this is not dump
for most devices you have a "file" called eg. "/dev/hda".
if you want raw access to the first harddisk, you chown this "file" to root.harddiskusers and chmod 770 - then any member of the group harddiskusers could access it in raw mode.
afaik for ethernet devices there is no /dev/eth0 but the device is created some kind of dynamically. but no "file" exists for that.
this is why you cannot have the above type of access to ethernet devices.
a better solution than suid-root would be sudo. then you can restrict who is allowed to call the program as root and who not.