System :: cups-1.3.5



There's one thing though - if I remember right, DSL has a root password set, it's just not disclosed what it is..
Quote
If the root password had not been set, then the script would have to open a terminal window for the user to be able to enter a password, no?

Or at least throw up some kind of error message that there's not a root password set. If curaga is right (I didn't know there's already a root password but hopefully it's randomized one-time-use like Finnix does so someone who figures it out can't pwn every "dsl@box" he sees) you probably want to have the user set one himself regardless. Even if a user uses "secure" cheatcode or has otherwise set one, all he has to do is remember what he used and re-enter it or enter a new one.

Yes, DSL does apparently have a root passwd set as well as for user dsl. And passwd -S does not work with busybox. Another simple trick may be to include :

#!/bin/bash

if sudo cat /etc/shadow | grep root:$1$$; then
 xterm -title "Set Root Passwork" -e sudo passwd
fi

This throws up an xterm window prompting for a root password if it has not already been set by the user, and exits when it has been entered. It looks to me like any time a root password is set, it only has one $ after the 1.

You're right in that "root:$1$$" changes to "root:$1$" in /etc/shadow after the root password is set, but - for me at least - grep does not seem to pick this up:
Code Sample
$ sudo cat /etc/shadow | grep root:    
root:$1$$I.X7vmLDEcVMmpJ9bU4Ar1:11456:0:99999:7:::
$ sudo cat /etc/shadow | grep root:$1$$
[nothing]
$ sudo grep 'root:' /etc/shadow
root:$1$$I.X7vmLDEcVMmpJ9bU4Ar1:11456:0:99999:7:::
$ sudo grep 'root:$' /etc/shadow
[nothing]

- seems grep doesn't like the "$"?

That's because $ has to be escaped in shell scripting because it's designated for variables. It can't have a trailing character or that part will be read as a variable. Try putting each $ you want read as $ in [], like [$].
Next Page...
original here.