PDA

View Full Version : How to add root and knoppix password automatically ?



ktheking
06-13-2003, 10:24 PM
Any idea how to add a root and knoppix password automatically ?
(without user intervention)

It's to create semi-customized knoppix. :shock:

It should launch FTP server and SSH server automatically at boot.
But without setting the password for knoppix this doesn't work.

Anyone an idea ? :?

Greetzzzzz,

probono
06-15-2003, 03:58 AM
I would use useradd to create a new user with password automatically in knoppix.sh. For detailed information on useradd, please see the man page.

ktheking
06-15-2003, 09:24 PM
Answer resided in article 'Headless knoppix' (docs division) :oops:

the line :


echo "knoppix:$PASSWORD" | chpasswd

does the trick.
Nevertheless you must be in root.
Since you can't sudo this with knoppix user ,you'll have to work with inbetween script.
The reason I use sh xxxx.sh is that I can use then from a remote drive. (I don't have to chmod it 8) - since I can't either )

How I pulled it off :

- launch KWrite (or other editor)
type here :


echo "knoppix:testpassword" | chpasswd

save it as setmyknoppix.sh

- Now type in knoppix console :


sudo sh setmyknoppix.sh

Now the password for knoppix is set to testpassword

This can also be applied for the root :wink: .

- launch KWrite (or other editor)
type here :


echo "root:rootpassword" | chpasswd

save it as setmyroot.sh

- Now type in knoppix console :


sudo sh setmyroot.sh

et voilą ....

greetzzzz...

ktheking
06-15-2003, 09:32 PM
Sorry chaps, seems you can't get bold into code :( .
So here is the good one

Answer resided in article 'Headless knoppix' (docs division) :oops:

the line :

echo "knoppix:$PASSWORD" | chpasswd
does the trick.
Nevertheless you must be in root.
Since you can't sudo this with knoppix user ,you'll have to work with inbetween script.
The reason I use sh xxxx.sh is that I can use then from a remote drive. (I don't have to chmod it - since I can't either 8) )

How I pulled it off :

- launch KWrite (or other editor)
type here :

echo "knoppix:testpassword" | chpasswd
save it as setmyknoppix.sh
- Now type in knoppix console :

sudo sh setmyknoppix.sh
Now the password for knoppix is set to testpassword

This can also be applied for the root .

- launch KWrite (or other editor)
type here :

echo "root:rootpassword" | chpasswd
save it as setmyroot.sh

- Now type in knoppix console :


sudo sh setmyroot.sh

Now the password for root is set to rootpassword

et voilą ....

greetzzzz...