The guide at https://github.com/yepher/littlebits/blob/master/CloubitFileSystem.md is mostly correct but has a few mistakes. Luckily I found this page in Japanese http://qiita.com/chobie@github/items/d41cfa2d60df5d7d1a3f (and I can read Japanese) to point me in the right direction for the right way to do this.
Note: I used an Ubuntu linux machine to mount and edit the microsdcard.
You should also make a backup image of the SD card just in case.
sudo apt-get install whois
on ubuntu if you don't have mkpasswd
.
Generate a password hash:
mkpasswd -m sha-512
All commands are relative to your mount point. Ubuntu will automatically mount to /media/<user>/littleRoot
.
- Change root shadow password hash
- Edit
etc/shadow
- Find root
- Replace the existing hash (between first 2 colons) with the one you generated
Enable sshd
Note: the symbolic link targets are absolute
cd etc/systemd/system/multi-user.target.wants/
sudo ln -s /usr/lib/systemd/system/sshdgenkeys.service sshdgenkeys.service
sudo ln -s /usr/lib/systemd/system/sshd.service sshd.service
Edit etc/ssh/sshd_config
Find and set/change/uncomment the following:
Listen 22
ListenAddress 0.0.0.0 # this one is probably optional
UsePAM no
PermitRootLogin yes
Edit usr/lib/sysctl.d/50-default.conf
Change icmp_echo_ignore_broadcasts from 1 to 0:
net.ipv4.icmp_echo_ignore_broadcasts = 0
Disable iptables by moving it to etc/systemd
mv etc/systemd/system/multi-user.target.wants/iptables.service etc/systemd
Unmount the sdcard and put it back into cloudbit and let it boot. Wait for the solid green light.
I checked my wifi router's device logs for the last device to request a DHCP address. This timestamp should match roughly the time you powered on the cloudbit.
ssh as root and login with the password you used to generate the hash.
ssh root@CLOUDBIT_IP_ADDRESS
You should now be able to add a different user so you don't have to login as root via SSH.
You may find https://github.com/Hixie/localbit interesting. Thanks for this gist; it was invaluable in getting me started down that path.