Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I create a kernel module without the use of sudo? I know the normal way(sudo insmod, sudo rmmod), but we're not allowed to use sudo in school.

share|improve this question
add comment

2 Answers 2

First off, what module do you want to insert and why? Normally there is no need to manually remove / insert modules. By the way, creating a module is a different story, insmod and rmmod are for loading / unloading a particular module (created by someone else).

Once you got your reasons straight, and are sure that there is no other way... then go to your system administrator and ask politely. Explain clearly your reasons, and you have a chance to succeed. No joke: unless you want to go against all rules (and some laws, probably) and hack the machine belonging to your school, you will not acquire privileges granting you such a low level operation.

share|improve this answer
    
Actually I'm just going to print the value of the page size of the Linux machine I am currently using. We're asked to demonstrate it with the use of kernel module. Aren't there any other way besides hacking and sudo? –  Sudoer Sep 11 '12 at 1:41
3  
You need to be root to play with the kernel. Sudo is just a way of doing that. Logging in as root is another. Having a suid insmod is another. And su is yet another. Yet I'm still wondering as to what kernel module you are referring to. Finding out the page size is as simple as typing getconf PAGESIZE. You might be on a wrong track... –  January Sep 11 '12 at 2:11
add comment

Perhaps an easier way forward is to do the kernel development inside a virtual machine; I use virt-manager + kvm-qemu, but there are other options such as VirtualBox. This allow can then allow you to do all the development in a safe virtualized environment and maybe allowed by your system administrator.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.