Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
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
One module in particular that it would be nice to remove and insert without sudo would be the pcspkr module to allow beep sometimes but not all of the time as it can get annoying. – mchid Jul 11 at 21:15

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

Your Answer


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.