Access terminal on boot
Access command line when program runs in background at boot
If a program is started automatically with e.g. ‘/etc/rc.local’, and you can’t use ‘ctrl-c’ to exit the running program, and you can’t access the pi through ssh, samba, ftp or in another way access the ‘/etc/rc.local’ file, here is a little trick to solve the problem: Take the sd card into another computer and edit the ‘cmdline.txt’ file. At the end of the line insert:
Save the file, put it back into the pi and start it. After a shorter boot than normal, you can access the command line. Edit the ‘/etc/rc.local’:
$ sudo nano /etc/rc.local
When finished turn off the pi and put the sd card back into the other computer and edit the ‘cmdline.txt’ file again and remove ‘init=/bin/sh’.