# How can I restrict a notebook to evaluate only if I am user 'root'?

I am playing with openCL on Linux with an AMD gpu, and due to a glitch in the driver, I need to be 'root' to get stuff to work.

Installation question here.

-
Did you try to add yourself to the sudo group ? –  b.gatessucks Oct 2 '12 at 13:40
@b.gatessucks, Whenever I tried to launch Mathematica using sudo, it wanted the authorization number. Now I can login as 'root' for these projects. The rest of the time I will be user 'fred'. –  Fred Kline Oct 2 '12 at 13:45

## 1 Answer

The variable \$UserName contains the current user's name. So if the very first thing your notebook does is to check whether it has the value "root", that should be enough.

Anyway, due to the security implications of running as root, I'd suggest that you try to fix the problem instead (it's probably some permission settings, or you have to be in a certain group).

-
It is only fixable by AMD. –  Fred Kline Oct 2 '12 at 13:50
@FredDanielKline: Just another idea: Does it work if you only run the kernel as root? (You could start a "remote" kernel as root on localhost, and set your notebook's kernel to that.) –  celtschk Oct 4 '12 at 7:57