Getting the magic Sysrq key to work (on Ubuntu)

edacval at gmail.com edacval at gmail.com
Wed Dec 29 19:49:29 EST 2010


Hi

> 
> Note that trying to sudo echo a value into /proc/sys/kernel/sysrq doesn't
> work:
> 
> *julie at zeus:/proc/sys/kernel$ cat sysrq
> 0
> julie at zeus:/proc/sys/kernel$ sudo echo "1" > sysrq
> bash: sysrq: Permission denied
> julie at zeus:/proc/sys/kernel$ ls -l sysrq
> -rw-r--r-- 1 root root 0 2010-12-29 19:37 sysrq
> *
> Instead, I have to explicitly log in as root:
> 
> *julie at zeus:/proc/sys/kernel$ cat sysrq
> 0
> julie at zeus:/proc/sys/kernel$ su
> Password:
> root at zeus:/proc/sys/kernel# echo "1" > sysrq
> root at zeus:/proc/sys/kernel# exit
> exit
> julie at zeus:/proc/sys/kernel$ cat sysrq
> 1*
> 
> or sudo a shell:
> 
> *julie at zeus:/proc/sys/kernel$ sudo bash
> [sudo] password for julie:
> root at zeus:/proc/sys/kernel# echo "1" > sysrq
> root at zeus:/proc/sys/kernel# exit
> exit
> julie at zeus:/proc/sys/kernel$ cat sysrq
> 1*
> 
> Which I presume might be counter-intuitive for some Ubuntu users, as AFAICR
> they're not encouraged to create an explicit root account but are expected
> to sudo
> everything instead - in other words they're likely to simply tag 'sudo' in
> front of
> any CL operation that would normally be root-only and expect it to work.
> 
sudo bash -c "echo 1 > /proc/sys/kernel/sysrq"
or
echo "1" |sudo tee /proc/sys/kernel/sysrq



More information about the Kernelnewbies mailing list