You are not logged in.

#1 2010-06-03 04:21:13

evil
Member
From: Indianapolis, IN
Registered: 2010-03-06
Posts: 41
Website

Sudo / Disabling Root

I just read the sudo page in the wiki (http://wiki.archlinux.org/index.php/Sudo) and read about disabling the root account at the bottom. There is a warning that arch linux may not be suitable for this. I am curious if any one has done this and had any issues or if it went smoothly.


Site | Blog | Freenode Nick: i686

Offline

#2 2010-06-03 04:44:11

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Sudo / Disabling Root

That's an interesting thing to try. yikes

Offline

#3 2010-06-03 08:04:57

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Sudo / Disabling Root

Why disable it?
If you are worried about other people accessing it, just give it some ridiculously difficult password and restrict the use of sudo. smile


neutral

Offline

#4 2010-06-03 08:08:26

sHyLoCk
Member
From: /dev/null
Registered: 2009-06-19
Posts: 1,197

Re: Sudo / Disabling Root

No issues. Even if you get any issues, use Live CD to fix. wink

Last edited by sHyLoCk (2010-06-03 08:08:45)


~ Regards,
sHy
ArchBang: Yet another Distro for Allan to break.
Blog | GIT | Forum (。◕‿◕。)

Offline

#5 2010-06-03 08:25:05

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Sudo / Disabling Root

Whenever you get dumped in a recovery shell in single user mode to fix filesystem issues, there's no way to login with a disabled root account.

Offline

#6 2010-06-03 10:36:21

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Sudo / Disabling Root

If you think that disabeling the root account is going to increase security, then you are wrong. (asuming the root password is somewhat sane).

It's usually much easier to get access to a normal user account, and if that account have full root access trough sudo....


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2010-06-03 11:04:06

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: Sudo / Disabling Root

Yeah, many people say that even using sudo is a big security flaw, as any script can call sudo and if it happens within 15 minutes of your previous sudo call, you might be screwed. Stick to root with a very good password, it's not that hard.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#8 2010-06-03 13:43:33

gablink
Member
Registered: 2010-05-21
Posts: 22

Re: Sudo / Disabling Root

SanskritFritz wrote:

Yeah, many people say that even using sudo is a big security flaw, as any script can call sudo and if it happens within 15 minutes of your previous sudo call, you might be screwed. Stick to root with a very good password, it's not that hard.

Yes but you can change the password timeout roll

Offline

#9 2010-06-03 19:26:54

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,924
Website

Re: Sudo / Disabling Root

Sigh...


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#10 2010-06-03 19:39:36

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Sudo / Disabling Root

Sudo definitally has its charm, using the root account only imho is tedious when you have to login everytime just to mount a device or shutdown/reboot your machine. I just make sure my user password is safe and only allow certain (much used) programs to be run with sudo in the first place. Can't remember the last time I've used my root account, but I would'nt recommend completely disabling it either for overall system stability.

Last edited by geniuz (2010-06-03 19:40:25)

Offline

#11 2010-06-03 19:43:51

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: Sudo / Disabling Root

gablink wrote:
SanskritFritz wrote:

Yeah, many people say that even using sudo is a big security flaw, as any script can call sudo and if it happens within 15 minutes of your previous sudo call, you might be screwed. Stick to root with a very good password, it's not that hard.

Yes but you can change the password timeout roll

It's also a good idea to use "Defaults tty_tickets". This way sudo prompts for your password separately in every shell.

Offline

#12 2010-06-03 20:26:02

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: Sudo / Disabling Root

gablink wrote:
SanskritFritz wrote:

Yeah, many people say that even using sudo is a big security flaw, as any script can call sudo and if it happens within 15 minutes of your previous sudo call, you might be screwed. Stick to root with a very good password, it's not that hard.

Yes but you can change the password timeout roll

And just duplicate su.

Offline

#13 2010-06-03 20:43:08

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Sudo / Disabling Root

i think you need to take a look at the sudoers file, some-guy94. sudo gives you much more flexibility than su.
you can make sudo permissions time out immediately, make it use root accounts password but for instance still maintain comfort by using NOPASSWD for commands you see fit.
For me, sudo eases things a lot and i wouldn't want to miss it.

I wouldn't want to miss the root account either though. So, instead of disabling it, I would just give it a very good password.


no place like /home
github

Offline

#14 2010-06-05 00:45:36

evil
Member
From: Indianapolis, IN
Registered: 2010-03-06
Posts: 41
Website

Re: Sudo / Disabling Root

Thanks for all the input. I think i'll just give it some insanely difficult password. I was just hoping to increase security.


Site | Blog | Freenode Nick: i686

Offline

#15 2010-06-05 01:26:00

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: Sudo / Disabling Root

And then one day, you'll be sitting there, becasue something's gone wrong, and think to yourself:
"What the heck was that insanely difficult root password again?" lol

Offline

#16 2010-06-05 05:53:13

evil
Member
From: Indianapolis, IN
Registered: 2010-03-06
Posts: 41
Website

Re: Sudo / Disabling Root

what is insanely difficult for one, may be easy for another.

i.e. "As I Walk Through The Valley Of The Shadow Of Death" -> AIWTTVOTSOD -> 41w77v0750d ... see how it works (btw, I dont use that phrase, just an example). It would be easy for me to remember, but for someone to magically come up with that phrase as a key to the actual password is improbable.


Site | Blog | Freenode Nick: i686

Offline

#17 2010-06-05 07:40:47

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: Sudo / Disabling Root

As a first try:

pacman -S pwgen
pwgen -s

I recommend taking at least 12 characters of its output.

Offline

#18 2010-06-05 09:47:41

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Sudo / Disabling Root

You can also abuse urandom:

echo $(< /dev/urandom tr -cd "[:graph:]" | head -c12)

Last edited by demian (2010-06-05 09:48:26)


no place like /home
github

Offline

#19 2010-06-05 11:29:23

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: Sudo / Disabling Root

demian wrote:

You can also abuse urandom:

echo $(< /dev/urandom tr -cd "[:graph:]" | head -c12)

That's what my password generator does, but with a page of C# code instead of a shell one-liner.  I would leave out the 'echo $( )' wrapping though (what if the RNG dumps out 'IFS=:;rm:-r:*'?).  If you want a trailing newline, put the pipeline in parens and follow it with '; echo' (stripping the single quotes).

Also, I think a 10-character password is enough if it is chosen at random from a 95-char alphabet.

Offline

#20 2010-06-05 12:40:55

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: Sudo / Disabling Root

rransom wrote:

I would leave out the 'echo $( )' wrapping though (what if the RNG dumps out 'IFS=:;rm:-r:*'?).

That's a funny thought. I wonder what the odds are?
How many chars are there including capital, special and all those chars urandom gives, not counting those stripped by [:graph:]?

Last edited by demian (2010-06-05 12:43:14)


no place like /home
github

Offline

#21 2010-06-06 17:32:48

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: Sudo / Disabling Root

/dev/urandom spews bytes, not characters.  If tr is using ASCII (LANG=C), [:graph:] passes 94 possible bytes (values 33 through 126).  ('95-char alphabet' in my last post was a thinko.)  If tr is using another character set (such as UTF-8 or Latin-1), [:graph:] can pass additional bytes and byte sequences.

The probability of getting a truly dangerous string like 'x;IFS=:;rm:*' (the one I suggested before is more than 12 characters, and it won't quite break anything because it doesn't have a semicolon before 'IFS') is low -- I suggested 10 characters so that there would be over 2^64 possible strings.  The probability of getting a semicolon (and very confusing behaviour) is much higher (in a 10-character string, 2^(-3.3)).

Offline

Board footer

Powered by FluxBB