Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

Is there a way to disable the root account completely on openSUSE so you can administer your system like the way you would do in Ubuntu?

share|improve this question
    
FYI. If is for a new installation, I think opensuse installer has this option. – Rufo El Magufo Sep 28 '11 at 23:47

http://sathyasays.com/2008/05/27/enabling-and-disabling-root-account-in-debianubuntu/

Basically, you just make sure the 'sudoers' file allows anybody in the 'admin' group (or whatever group you want) to execute files using 'sudo':

%admin ALL=(ALL)

Then you disable the 'root' account password with:

passwd -d root

This should work with openSUSE too.

share|improve this answer
    
Does it also fix Policykit? – Jonathan Frank Sep 28 '11 at 15:47
2  
you might want to use passwd -d root, rather than passwd -l root. the -d option disables the password for root, but leaves the account in an active state that will still run cron jobs, etc. – Tim Kennedy Sep 28 '11 at 16:42
    
Oh, sorry; I've never used PolicyKit. I've always just used sudo. With PolicyKit, don't you just tell it what commands a regular user can run? Would disabling 'root' affect that at all? If 'root' still needs to be enabled for PolicyKit to work, you could always just set root's shell to '/bin/false'. EDIT: Good call, Tim Kennedy! I'll edit that in. – Kasius Sep 28 '11 at 16:49

I would not recommend disabling the root account by blanking the root password. This will create implication for the user when working in GUI. E.g. YaST requires specifically the root password. As sudo is not a program and a built-in command, it cannot be invoked by GUI. You will then have to invoke YaST from CLI using sudo to be able to make any changes. You will also not be able to shut down the machine from within GUI if file permissions set to secure or paranoid.

I would recommend disabling the root login by changing the root shell to "nologin", e.g.

root:x:0:0:root:/root:/bin/nologin

in /etc/passwd

share|improve this answer
    
Welcome to U&L, and nice first answer! – cat Feb 3 at 15:48

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.