Raspberry Pi¶
Install Raspbian¶
Download image, verify the checksum and write it on SD card:
SSH¶
- Enable ssh-agent on your main host and copy your public ssh key to RPi:
ssh-copy-id pi@192.168.0.11 -p 222 -
Generate keys on RPi:
ssh-keygen -t ecdsa -b 521 -
Enable SSH server on RPi
Setup auto screen on ssh login¶
nano ~/.bashrc
+ # Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
+ # if we're coming from a remote SSH connection, in an interactive session
+ # then automatically put us into a screen(1) session. Only try once
+ # -- if $STARTED_SCREEN is set, don't try it again, to avoid looping
+ # if screen fails for some reason.
+ if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
+ then
+ STARTED_SCREEN=1 ; export STARTED_SCREEN
+ screen -RR && exit 0
+ # normally, execution of this rc script ends here...
+ echo "Screen failed! continuing with normal bash startup"
+ fi
+ # [end of auto-screen snippet]
nano ~/.screenrc
# Enable scroll in screen
defscrollback 10000
termcapinfo xterm* ti@:te@
# see http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
# support color X terminals
termcap xterm 'XT:AF=\E[3%dm:AB=\E[4%dm:AX'
terminfo xterm 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX'
termcapinfo xterm 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
termcap xtermc 'XT:AF=\E[3%dm:AB=\E[4%dm:AX'
terminfo xtermc 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX'
termcapinfo xtermc 'XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
# auto-screen support; see http://taint.org/wk/RemoteLoginAutoScreen
# detach on hangup
autodetach on
# no startup msg
startup_message off
# always use a login shell
shell -$SHELL
3g/4g usb modem¶
You can use any 3g/4g usb modem. For example one of these modems.
After installing Raspberry Pi we need to initialise a system that will allow us to connect to Raspberry Pi via SSH access. For this we will setup a virtual machine using Google Cloud. The tutorial on how to do it is here.