0

In the past, Debian presented an action menu upon initial boot after install where you could confirm "login as root." When that option disappeared, I stopped defining the root user.

However I now need to be root user in gdm to use tools that work better graphically.

This is what I want to do:

1) Open the root terminal and enter my password.
2) Login as root
3) Exit the root terminal and do my thing as root.
4) Use the normal login to get back to my account.

My current work-around is to launch the apps from the root terminal. I have to do this for BOINC-Client to access the AMD gpu driver for some openCL apps.

When I try to do the same with Mathematica, I have to authenticate each time. I prefer not to do this.

The plan is to run BOINC as I am currently doing and shutting it down before I switch to root. After I switch back, I will relaunch it. It uses the same resources (the gpu) as the Mathematica project.

How can I do this?

3
  • 1
    Look at setting the suid for those apps
    – slashmais
    Sep 30, 2012 at 10:57
  • @slashmais, suid did not fix it. Nice idea, though! Sep 30, 2012 at 11:56
  • look at superuser.com/questions/481080/… - I just answered a similar question 'how two run sudo under X'. Sorry for self-promoting)
    – Serge
    Sep 30, 2012 at 14:58

3 Answers 3

3

Assuming you are on Debian 6, edit /etc/gdm3/daemon.conf and add the following line

AllowRoot=true

under the security options. Then comment out the following line in /etc/pam.d/gdm3

auth   required        pam_succeed_if.so user != root

You should then be able to login

2
  • Perfect! Exactly what I needed. Sep 30, 2012 at 18:24
  • 1
    From user th.sigit: On Debian 8, I do not have /etc/pam.d/gdm3 file but I have /etc/pam.d/gdm-password, so I edited that file instead.
    – fixer1234
    Jan 5, 2016 at 6:33
3

You really don't want to be running X as root. But this might fix it for you:

The root account probably doesn't have a password; if the security settings on the Linux box (you should investigate PAM, some time) are such that accounts with no password cannot log in, root login is blocked. To fix this, do the following:

  1. Log in to X as your normal user.
  2. Open a terminal window.
  3. Run sudo su -. You will be prompted for your password.
  4. You should now be logged in as root (in the console session running in the terminal window, that is).
  5. You can now set a password for root by running passwd.
  6. Run exit twice (to log you out first as root then as you, which will close the terminal window) or just kill the terminal window.
  7. Logout of your GUI session, try.
1
  • Tried it. Still no root login. It set the password, however I think the "no root login" setting is still set somewhere. I don't have a clue. Sep 30, 2012 at 13:58
2

You shouldn't have to run applications as root that you use often. There are nicer ways to sort this.

But take a look at gksu or kdesu, you might find that useful. You could even set up your shortcuts to use it automatically.

3
  • Currently, the only way to access the AMD openCL libraries is to be root user. I have tried those two commands without success.
    – Fred Daniel Kline
    Sep 30, 2012 at 10:54
  • You should not need to be root to run OpenCL. If you need to be root for that, some permissions are wrong when OpenCL was installed. Sep 30, 2012 at 11:05
  • 1
    @BasileStarynkevitch, something in the AMD package is wrong. The work-around is to run as root. See this post.
    – Fred Daniel Kline
    Sep 30, 2012 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .