0

Hi,
I need to load modules to connect to the internet, so I've created a script.

Script file is called 'connect.sh' is owned by root and has permissions set to 4755, so it is executed as root, even if run by non-root user (at least I think so). I still get errors:

When script comes to line '/sbin/modprobe pppoatm' it gives:
WARNING: Error inserting slhc (/lib/modules/2.6.24.4-64.fc8/kernel/drivers/net/slhc.ko): Operation not permitted
WARNING: Error inserting ppp_generic (/lib/modules/2.6.24.4-64.fc8/kernel/drivers/net/ppp_generic.ko): Operation not permitted
FATAL: Error inserting pppoatm (/lib/modules/2.6.24.4-64.fc8/kernel/net/atm/pppoatm.ko): Operation not permitted

Any idea?

PS: I really would like to avoid changing any other files than the script file 'connect.sh' if possible...

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by edek
1

Funnily enough, just last week I wrote a little howto on this (see my website in my signature for more info). The reason for the problem you're experiencing is that while most *nix distributions work fine when the setuid bit on a binary is turned on, the distributions specifically disable the use of setuid bits on shell scripts, due to their insecure nature.

There are two possible workarounds: a) edit the sudoers file so that sudo doesn't require a password for the commands that you need to execute in your shell script, or b) call the script from a C program using the system() call.

0

Thank you very much for your help! I will check if it works later, but I think it will. Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.