mmatuska / mfsbsd

mfsBSD
http://mfsbsd.vx.sk
BSD 2-Clause "Simplified" License
494 stars 137 forks source link

root password does not work #102

Closed jfoucry closed 5 years ago

jfoucry commented 5 years ago

Hello,

It MUST be me, but, the default root password seems to not work on https://mfsbsd.vx.sk/files/images/12/amd64/mfsbsd-se-12.1-RELEASE-amd64.img image.

I check with a friend who cannot connect to my machine too.

Password for root@mfsbsd:
Password for root@mfsbsd:
Password for root@mfsbsd:
root@xxx.xxx.xxx.xxx: Permission denied (publickey,keyboard-interactive).
mmatuska commented 5 years ago

Thank you for the notice! I have replaced all 12.1 images.

grembo commented 5 years ago

@mmatuska I was just about to click submit on a long bug report on this :) Good to see that it was already addressed. The issue was that no root password was set at all (empty), therefore ssh login didn't work.

I'll just leave this little script that I used to poke into various images while I was looking into the issue here, maybe it'll be useful for someone else in the future:

#!/bin/sh

set -e

MDUNIT="md11"
mdconfig -l -u ${MDUNIT} && /usr/bin/false
MDDEV="/dev/${MDUNIT}"
TEMPDIR=/tmp/mfsbsd$$
mkdir -p ${TEMPDIR}/mnt

for file in "$@"; do
  stat -f "%N (%Sm):" "${file}"
  mdconfig -f "${file}" -u ${MDUNIT}
  if echo ${file} | grep -Eq "\.iso\$"; then
    fstype="cd9660"
    device="${MDDEV}"
  else
    fstype="ufs"
    device="${MDDEV}p2"
  fi
  mount -t ${fstype} ${device} ${TEMPDIR}/mnt
  zcat ${TEMPDIR}/mnt/mfsroot.gz >${TEMPDIR}/mfsroot
  umount -f ${device}
  mdconfig -du ${MDUNIT}

  mdconfig -f ${TEMPDIR}/mfsroot -u ${MDUNIT}
  mount ${MDDEV} ${TEMPDIR}/mnt
  if [ -e ${TEMPDIR}/mnt/root.txz ]; then
    tar -xOf ${TEMPDIR}/mnt/root.txz rw/etc/master.passwd | egrep "^root"
  else
    egrep "^root" ${TEMPDIR}/mnt/etc/master.passwd
  fi
  umount -f ${MDDEV}
  mdconfig -du ${MDDEV}
  rm ${TEMPDIR}/mfsroot
done
rmdir ${TEMPDIR}/mnt
rmdir ${TEMPDIR}

Usage:


# ./check_mfsbsd_root_password.sh mfsbsd*.i??
mfsbsd-12.0-RELEASE-amd64.img (Nov 22 00:56:42 2019)
root:$6$JbeuO5eUqnLK7nNE$6aBm6MXXAUi7omRbs41K1H4wnJP9ICxynLDXqU5rqSRmgVHmku1i/OETw923lYpIYLOohrB4UOEMiWGiMgrAM.:0:0::0:0:Charlie &:/root:/bin/csh
mfsbsd-12.0-RELEASE-amd64.iso (Nov 22 00:02:16 2019)
root:$6$JbeuO5eUqnLK7nNE$6aBm6MXXAUi7omRbs41K1H4wnJP9ICxynLDXqU5rqSRmgVHmku1i/OETw923lYpIYLOohrB4UOEMiWGiMgrAM.:0:0::0:0:Charlie &:/root:/bin/csh
mfsbsd-se-12.1-RELEASE-amd64.img (Nov 21 16:50:47 2019):
root::0:0::0:0:Charlie &:/root:/bin/csh
mfsbsd-se-12.1-RELEASE-amd64.iso (Nov 21 16:29:54 2019):
root::0:0::0:0:Charlie &:/root:/bin/csh
mmatuska commented 5 years ago

@grembo thank you for the script! I would go one step further as Cirrus CI supports FreeBSD 12 VMs we can test the whole build process online.

jfoucry commented 5 years ago

Thanks for your job and your fast answer.

jfoucry commented 5 years ago

It solved \o/