Author Topic: How to get the bootable CD with a non-blank password for root  (Read 9798 times)

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
How to get the bootable CD with a non-blank password for root
« on: October 20, 2011, 20:14:42 PM »
i got that question today

the answer is:

bootup the cd and set a password for root with the command "passwd"

then run this commands
Code: [Select]
cp /media/ploplinux/etc.sqfs /tmp
cd /tmp
unsquashfs etc.sqfs
rm etc.sqfs
cp /etc/shadow squashfs-root/
mksquashfs etc.sqfs

copy the new etc.sqfs to a hard disk with the files for a new livecd and replace the old etc.sqfs with your new one.


dindeman

  • Newbie
  • *
  • Posts: 5
Re: How to get the bootable CD with a non-blank password for root
« Reply #1 on: October 22, 2011, 05:18:16 AM »
Hi Elmar.

In your FAQs you already described in question 10 how to append the ISO file to get to a bootable ploplinux CD with a preset password.
I followed these instructions and it worked perfectly fine.
So to say:

  • Edit rc.local
  • Add the shadow file under /ploplinux/opt

A bit of background:
I need to boot a headless server with Linux with a root user auto-logged in and SSH ready to use straight away.
I will test this very soon on the actual server but it might be that its CD/DVD is not set to receive bootable medias, in which case I will surely need to ask more questions about the network boot feature using PXE.

Thanks a million so far!
- d

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
Re: How to get the bootable CD with a non-blank password for root
« Reply #2 on: October 22, 2011, 11:09:57 AM »
Hi Elmar.

In your FAQs you already described in question 10 how to append the ISO file to get to a bootable ploplinux CD with a preset password.
I followed these instructions and it worked perfectly fine.
So to say:

  • Edit rc.local
  • Add the shadow file under /ploplinux/opt

A bit of background:
I need to boot a headless server with Linux with a root user auto-logged in and SSH ready to use straight away.
I will test this very soon on the actual server but it might be that its CD/DVD is not set to receive bootable medias, in which case I will surely need to ask more questions about the network boot feature using PXE.

Thanks a million so far!
- d

yes, the faq method works too and is a quick and easy method. and the password will be set when you update to another ploplinux release. but when people want to have the shadow file more hidden (because they share the iso with others, or whatever), then they have to use the method described above.

you will be able to login via ssh when the root password is set

regards
elmar

dindeman

  • Newbie
  • *
  • Posts: 5
Re: How to get the bootable CD with a non-blank password for root
« Reply #3 on: October 26, 2011, 05:35:16 AM »
Hey Elmar.

A bit of feedback on what happened, if you don't mind.

So in the end I could achieve what I wanted to do (reset vmware's ESXi root password on a headless server) using your plop distro of Linux.
This server machine on which ESXi is installed would only allow network boot, no CD, no USB.
So I followed your instructions about the PXE boot and it worked fine but somehow ploplinux itself couldn't be loaded, just what comes before ploplinux itself, so in my guess whatever is in syslinux right ?
However at the stage where the error message occurs there is an option to plug in a USB drive or a CD and, since I had made a ploplinux CD I put that one in and ploplinux could fully load, sweet. Saved my life.
In the end I did a mix between a network boot and a completion with the CD.
I am not in front of the error screen right now but it was complaining about an unfound path on \\10.0.0.1\ploplinux
If this doesn't ring a bell to you I can reproduce it to paste here the exact error message but it was happening at the mounting of samba (if that makes any sense), so it would fail but leave the option to plug in a CD... which worked as I just explained.

Anyway this is more out of curiosity as I managed to do what I needed to do but yeah I'd be keen to manage this network boot properly for the sake of learning.

Nevertheless, thank you again so much for your help and for producing this lightweight distro that's got all one needs for troubleshooting really.
Cheers!

- dindeman

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
Re: How to get the bootable CD with a non-blank password for root
« Reply #4 on: October 26, 2011, 10:01:27 AM »
i think you simply share the wrong directory or you did not extract the ploplinux files to the shared directory

whats the full local path of the \\10.0.0.1\ploplinux share?
when you mount \\10.0.0.1\ploplinux by hand, what files do you see in the share?

regards
elmar

dindeman

  • Newbie
  • *
  • Posts: 5
Re: How to get the bootable CD with a non-blank password for root
« Reply #5 on: October 26, 2011, 11:07:40 AM »
The locally shared folder is C:\tftpboot\ploplinux
But maybe the problem lies in the lines that I edited in \ploplinux\pxelinux.cfg\default:

label linux
    menu label Plop Linux
    kernel kernel/bzImage
    append initrd=kernel/initramfs.gz vga=1 smbmount=//10.0.0.1/ploplinux:username:password


label linuxfb
    menu label Plop Linux framebuffer mode
    kernel kernel/bzImage
    append initrd=kernel/initramfs.gz vga=0x317 smbmount=//10.0.0.1/ploplinux:username:password


Where username and password are the user name and password of the Windows (Vista btw) user that is set up in the folder sharing permission.
Is that how it should be ?

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
Re: How to get the bootable CD with a non-blank password for root
« Reply #6 on: October 26, 2011, 11:18:05 AM »
when the windows username that has the permission to mount the share is "kirk" and the password is "123" then the line must be

Code: [Select]
    append initrd=kernel/initramfs.gz vga=1 smbmount=//10.0.0.1/ploplinux:kirk:123


simply test the share mount with booting the plop linux cd and use

Code: [Select]
mount //10.0.0.1/ploplinux /mnt -o username=kirk
ls /mnt
« Last Edit: October 26, 2011, 11:19:37 AM by Elmar »

dindeman

  • Newbie
  • *
  • Posts: 5
Re: How to get the bootable CD with a non-blank password for root
« Reply #7 on: October 28, 2011, 15:08:36 PM »
Hi Elmar, sorry about the delay.

Mmmm, I get this

CIFS VFS: Error connecting to socket. Aborting operation
CIFS VFS: cifs_mount failed w/return code = -115


However I definitely shared the right folder (C:\tftpboot\ploplinux) and I'm passing on the right credentials.
The ploplinux files are definitely in there with the

C:\tftpboot
    \ploplinux
        \ploplinux
            \syslinux
            \ploplinux


structure.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
Re: How to get the bootable CD with a non-blank password for root
« Reply #8 on: October 28, 2011, 15:18:26 PM »
CIFS VFS: Error connecting to socket. Aborting operation
CIFS VFS: cifs_mount failed w/return code = -115


maybe your windows firewall is blocking the connection.

as long as you cannot mount from the livecd, so long the full network boot will not work.


C:\tftpboot
    \ploplinux
        \ploplinux
            \syslinux
            \ploplinux



here is a ploplinux directory too much
« Last Edit: October 28, 2011, 15:59:41 PM by Elmar »

dindeman

  • Newbie
  • *
  • Posts: 5
Re: How to get the bootable CD with a non-blank password for root
« Reply #9 on: November 02, 2011, 12:21:13 PM »
Hey Elmar.

Ok you were right I had the wrong tree structure and there was indeed one ploplinux directory too much.
The fact is that by following strictly your guideline :

Quote
Extract the file ploplinux-4.1.2.zip to c:\tftpboot\ploplinux

Rename ploplinux-4.1.2\ to ploplinux\. This Directory is after renaming c:\tftpboot\ploplinux\ploplinux\

then we don't end up with the indicated tree structure.
For me to make it work I had to perform the additional step of moving the content of the lowest ploplinux folder (the one that then sits at the same level than the syslinux folder after extraction) beside the syslinux folder. Eventually getting this:

c:\tftpboot\
           \ploplinux\
                     \boot.msg
                     \memtest
           \menu.c32
           \spash.png
           \vesamenu.c32
                     \pxelinux.0
           \kernel\
                  \bzImage
             \initramfs.gz
           \plop\
                \plpbt.bin
           \plpinstc.com
                     \ploplinux\
                               \syslinux
                               \bin.sqfs
                               \etc.sqfs
                               \lib.sqfs
                               \ploplinux
                               \bin\
                \opt\
                     \pxelinux.cfg\
                                \default


So now I can really perform the exercise of booting the headless server blindly until the moment when I can connect through SSH. Sweet.
Thanks again !

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2421
  • a command shell is enough to do amazing things
Re: How to get the bootable CD with a non-blank password for root
« Reply #10 on: November 02, 2011, 12:52:45 PM »
Hey Elmar.

Ok you were right I had the wrong tree structure and there was indeed one ploplinux directory too much.
The fact is that by following strictly your guideline :

Quote
Extract the file ploplinux-4.1.2.zip to c:\tftpboot\ploplinux

Rename ploplinux-4.1.2\ to ploplinux\. This Directory is after renaming c:\tftpboot\ploplinux\ploplinux\

ups, the docu is so many years old and has a bug. i updated it.

thanks for the info


best regards
elmar