Other Help Topics :: setting root passwd for headless system



Hello,

Ive remastered a DSL CD to boot to "dsl 2 ssh ftp" for a headless system, so that I can get in and repair stuff if an install or grub or something goes squiffy.

But I cannot find a way to automatically set the root or dsl passwd on startup.

Ive tried variations of "passwd <<EOF" and "echo 's3cr3t' | passwd" in the startup script, but nothing works, so Im still plugging in a keyboard and typing blind.

Anybody know how to make DSL accessible via ssh from CD boot with no user interaction at the keyboard?

I haven't tried it, but if I had to I'd do something like this....

echo 's3cr3t' | passwd --stdin username

How do you access the headless system? Serial console or ethernet?
The former option you need to hack the 'getty' daemon on the DSL box.

There is an excellent tutorial on "BSD Hacks", O'Reilly, which I'd like to port to DSL if I had time.

Quote (mikshaw @ June 01 2006,18:36)
I haven't tried it, but if I had to I'd do something like this....

echo 's3cr3t' | passwd --stdin username

There is no --stdin option on the DSl passwd command  :(

Its a lounge PC thats going to be running though my TV when I get things running, but currently I am carrying a monitor downstrair to try and do an install of gentoo.

I just want a rescue disk at the ready in case things go wrong and I need to repair a partition or something. Then I can slip the DSL CD in, and run upstairs to ssh into the box, chroot to wherever and start fixing stuff. At the moment I have to hang around, guess when DSL has booted, and type "passwd" "s3cr3t" "s3cr3t" before running upstairs.

I'm now thinking a passwd -d root could work.

Another option is to set up your password and then backup /etc/shadow.  Make a mydsl cd remaster with your backup in the root of the CD, and it should automatically overwrite the original so you won't need to set the password each time you boot the cd.
Next Page...
original here.