#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    BCN
    Posts
    84
    Rep Power
    13

    Network programming with Libnet and permissions.


    Hello Everybody,
    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.
    Thank you!!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    you can make the specific program suid-root.
    that is:
    chown root.root <program>
    chmod 4777 <program>

    then you can start it as user but it will run with root permissions.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    BCN
    Posts
    84
    Rep Power
    13

    Smile 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 :-(.
    Thanks !!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    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.

IMN logo majestic logo threadwatch logo seochat tools logo