943,902 Members | Top Members by Rank

Ad:
Apr 6th, 2008
0

Problem loading module as not-root

Expand Post »
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...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
edek is offline Offline
113 posts
since Oct 2006
Apr 6th, 2008
2

Re: Problem loading module as not-root

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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Apr 7th, 2008
0

Re: Problem loading module as not-root

Thank you very much for your help! I will check if it works later, but I think it will. Thanks!
Reputation Points: 10
Solved Threads: 0
Junior Poster
edek is offline Offline
113 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Kernel and Hardware Setup Forum Timeline: running CentOS(fedora in vmware)
Next Thread in Linux Kernel and Hardware Setup Forum Timeline: Top 10 weirdest computers revealed





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC