May 5, 2024

Antminer S9 board - Console and root password

I was greatly pleased to find that it is as easy as pie to clear out the root password on these boards.

Connect up a serial console and type 'd' as instructed to interrupt the U-boot sequence and get to a U-boot prompt. Then type these commands to get a root shell:

nand read 0x2000000 0x1100000 ${kernel_size}
nand read 0x3000000 0x1020000 ${devicetree_size}
setenv bootargs 'noinitrd mem=496M console=ttyPS0,115200 root=ubi0:rootfs ubi.mtd=1 rootfstype=ubifs rw rootwait init=/bin/sh'
bootm 0x2000000 - 0x3000000
Note: One of my boards had 1G of ram rather than the usual 512M (a nice bonus). The above bootargs will not work for it, rather use:
setenv bootargs 'noinitrd mem=1008M console=ttyPS0,115200 root=ubi0:rootfs ubi.mtd=1 rootfstype=ubifs rw rootwait init=/bin/sh'
Now you should have bash running and ready for action. Then do this:
Edit /etc/shadow
cd /etc/rcS.d
mv S70bmminer.sh K70bmminer.sh
Note in the above, this is rcS.d (with a capital S), not rc5.d (with the number 5).

Don't reboot yet, there is more to do (see below).

The miner software still seems to run. The following seems to knock it out of orbit:

cd /etc/rcS.d
mv S37bitmainer_setup.sh K37bitmainer_setup.sh
cd /usr/bin
mv bmminer bmminerXX
sync

Halt won't work yet in this single user mode. Cycle power and it should boot up and will have no password for root (or whatever you set). I just clear the encrypted password entirely in the shadow file, but you may prefer to set a password.

The reboot will take a while if you don't have a network cable connected as it is trying to get a DHCP response. Be patient and you will get an "Angstrom" greeting and a login prompt.

More work will be required to (perhaps) set up a static IP address and shut down things we don't want (and make sure things we do want -- like ssh -- are running.)

I have dealt with Angstrom linux in the past (on the Beaglebone Black) and hated it. We will see how it is on these boards. Searching on it today (2024), I see it called a "defunct linux distribution". It apparently died a well deserved death around 2017.


Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]