Download Debian image [whatever].img.xz http://beagleboard.org/latest-images Insert microSD card and make sure that it is unmounted Copy the img to the microSD card This step will take a lot of time. Mount the microSD card and make sure it flashes to the
beaglebone: Uncomment the line: Hookup the USB-to-serial cable Connect to USB, check output of Connect to serial connection via screen put sdcard in BBB and power up, hold the S2 button, power
up Wait, the status lights will flash in a cylon pattern, you can
watch the eMMC flash progress via All User LEDs should be solid on completion More info is available on the BeagleBoneBlack
Wiki To connect via ssh: plugin beaglebone to computer via SSH Plugin the wifi
adapter Reboot (unplug it and plug it back in) Generate your pre-shared key using vim use Use the Debian
Upgrade Script to update debian: Generate a non-privileged user password:
Save password in password store Add the user give that user sudo privileges Add your laptop's key to user's Generate better hostkeys Modfiy Restart SSH Open a new terminal window and make sure you can still login (you
may need to delete and reaccept hostkeys) Change ssh banner: BeagleBone pin-out thank god for 1wire temp sensor blog posts: http://interactingobjects.com/ds18b20-temperature-sensor-on-a-beaglebone-black-running-ubuntu/ http://klaus.ede.hih.au.dk/index.php/BBB_and_OneWire iwconfig when can't find wlan0 interface (could be wlan1) Clone repoFlash eMMC with latest Debian image
unxz bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz
lsblkfdisk -lsudo dd bs=4 if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/mmcblk0 conv=fsyncsudo mount /dev/mmcblk0p1 /mnt/sd-card
vim /mnt/sd-card/boot/uEnv.txtcmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
dmesg for which
/dev/ the serial connection is onscreen /dev/ttyUSB0 115200screenInitial setup
Connect over SSH
ssh -l root 192.168.7.2Wifi Setup
wpa_passphrase
(see Debian
Wiki)/etc/network/interfacesauto wlan0
iface wlan0 inet dhcp
wpa-ssid "network-name"
wpa-psk "network-password"ifdown wlan0; ifup wlan0ip -o addr show to confirm that you have an ip
addressUpdate debian
#!/usr/bin/env bash
# Debian auto-upgrade script
# https://debian-handbook.info/browse/stable/sect.automatic-upgrades.html
# kill all cached creds
sudo -k
# ask for new creds
sudo -v
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
yes '' | sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgradeBasic security
Make a root password
pwgen:
sudo apt-get install pwgenpwgen -Bsy 16 1passwdAdd a privileged non-root user
pwgen -Bsy 16 1sudo groupadd sudo-user
sudo groupadd ssh-user
useradd tyler
mkdir /home/tyler
mkdir /home/tyler/.ssh
touch /home/tyler/.ssh/authorized_keys
chown -R tyler:tyler /home/tyler
chmod 700 /home/tyler/.ssh
chmod 600 /home/tyler/.ssh/authorized_keys
usermod -a -G sudo-user tyler
usermod -a -G ssh-user tyler
usermod --shell /bin/bash tyler
passwd tyler
EDITOR=vim visudo -f /etc/sudoers.d/sudo-user%sudo-user ALL=(ALL) NOPASSWD:ALLauthorized_keys# This should happen from your local machine: laptop/desktop/whatever
cat ~/.ssh/id_rsa.pub | ssh -l tyler 192.168.7.2 'mkdir -p .ssh && cat >> ~/.ssh/authorized_keys'Remove demo user
userdel -fr debianLockdown ssh
cd /etc/ssh
rm ssh_host_*key*
ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null/etc/ssh/sshd_config to make it like
below:Ciphers aes256-ctr,aes192-ctr,aes128-ctr
KexAlgorithms diffie-hellman-group-exchange-sha256
MACs hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
PubkeyAuthentication yes
PermitRootLogin no
PasswordAuthentication no
AllowGroups ssh-userservice ssh restartFun Stuff
sudo apt-get install figlet
awk '$1 !~ /default/' /etc/issue.net > ~/issue.net && sudo mv ~/issue.net /etc/issue.net
sudo sh -c 'figlet BeagleBone >> /etc/issue.net'Things to remember
Installing
Neovim
sudo apt-get -f install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip libmsgpack-dev libuv-dev libluajit-5.1-devgit clone https://github.com/neovim/neovim.gitcd neovim
make
sudo make installSetup
Neovim
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
Posted
Posted