Software > Firmware

annoying missing sshd corner case with manually edited users

(1/1)

hiryu:
After some back and forth on twitter, the notes have been updated:
https://twitter.com/RaptorCompSys/status/1230723235961917440

But I will give a run down on how this seemed to occur to me.
a. /etc/passwd- was giving me a random "stale file handle" issue... Which was preventing me from writing to /etc/passwd, as /etc/passwd could not be backed up to /etc/passwd-
b. Restarting the BMC fixed this so this "stale file handle" issue is intermittent?
c. Ultimately the issue here is that /etc/passwd is persistent and I had added a user. The new version of the file which can be found here: /run/initramfs/ro/etc/passwd, has the sshd user.

From here... it's clear that useradd is _really_ broken. It complains:
useradd: PAM: Permission denied

Probably needs to be built without PAM support?

adduser won't give you a list of options it accepts and it's the busybox version so who knows? Turns out it seems to _mostly_ have parity with Debian 10's adduser.

Here is how I ultimately was able to get this working:
1. addgroup --system sshd
2. adduser --system --home /var/run/sshd --shell /bin/false sshd (ignore the error about the sshd group)
3. usermod -g sshd sshd
4. chown root:root /var/run/sshd

Theoretically and ideally, the above steps should be performed BEFORE the upgrade to avoid having to hook up a serial cable.

My steps won't provide the same UID/GID as in the release notes, but will use the next available system UID/GID, which will work just as well. You could also modify the user or add some CLI switches to match Raptor's settings.

(edited to make minor fix to step 2 adduser command)

hiryu:
So I decided to try and reflash the BMC using the risky technique described under known issues:
https://wiki.raptorcs.com/wiki/Talos_II/Firmware/2.00/Release_Notes

I removed /etc/passwd and /etc/group and immediately rebooted... It didn't work.

The good news is that after 4-5 hours, I finally figured out how to make tftpboot work from u-boot. The instructions on the wiki aren't 100% correct.

I'd like to be able to provide what needs to be fixed.

2 things from the top of my head:
a. Disabling the FPGA watchdog for the Blackbird isn't the same as the Talos. The procedure is the same, but the code is different as the BB has differing addresses.
b. The instructions to download and boot the BMC image aren't quite right.

hiryu:
Here's the code to compile in order to disable the FPGA on a Blackbird system:
#include <stdint.h>
int main() {
    uint32_t* gpio_ctl_reg = 0x1e780024;
    uint32_t* gpio_data_reg = 0x1e780020;

    *gpio_ctl_reg |= 0x00010000;
    *gpio_data_reg &= ~0x00010000;
    return 0;
}

Otherwise the directions here work:
https://wiki.raptorcs.com/wiki/Debricking_the_BMC/Watchdog

Navigation

[0] Message Index

Go to full version