Not every project you will do will require you to use a display directly attached to the Banana Pi. You can connect to the device remotely from one of your other computers on the network and run the Pi headless (with no display). This is accomplished using SSH. By default, SSH is installed on Raspbian and Bananian out-of-the-box. For this, you will need to make sure that the Banana Pi is connected to the same network as your computer.
Windows does not come with an SSH client out-of-the-box. You need to download one. The most common application for this is called PuTTY. PuTTY is a free application you can download from its website (http://www.chiark.greenend.org.uk/~sgtatham/putty/). The application does quite a bit when you get right down to it but we just need the bare-bones configuration.
ifconfig
eth0
, and if you are wireless; you will look for wlan0
. The IP address you need will be preceded by inet
. The output of the command looks like this:eth0 Link encap:Ethernet HWaddr 02:07:05:01:d2:44 inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::7:5ff:fe01:d244/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:86523 errors:0 dropped:0 overruns:0 frame:0 TX packets:1649 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9430022 (8.9 MiB) TX bytes:115701 (112.9 KiB) Interrupt:117 Base address:0xc000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
For your benefit, if you are using a Mac computer or Linux you have a terminal emulator built in. Although you can download PuTTY on Linux, you don't need to, because all you need to do is run the SSH command. On either Mac or Linux open up your bash terminal and run this command:
Share this:
ssh user@ipaddress
The user is whichever user you plan to run as, and the IP address is specific to your device within your network. For example, if my IP address is 192.168.1.6 and I want to connect as root, I will run the command like so:
Now I will be logged in as root. You will be prompted to remember the connection and be asked for the password. You can create an SSH key to automatically log you in, but for what we are doing this won't be necessary for now.
It is possible to connect to your device over SSH from outside your network but this is something that is specific to your network. One thing that is common and that you will need to do, is forward the port you want to use for SSH (commonly 22) and route that connection to the Pi. This of course will open up a hole in your firewall and allow traffic over that port for that device. This means you will need to secure your connection in more ways such as by changing the default port, adding a new user, and restricting root access. This is useful for projects where you need to remotely connect such as file servers or remote web servers.
Depending on the applications you plan to run remotely you will need to open different ports. If you are accessing the Pi over SSH you will need port 22; if you are running a web server you will need 80, 8080, or whatever port you have decided on. By default, if you are using it as a remote database server for MySQL, you will need 3365. These ports are all configurable but you will need to take this into consideration depending on what you plan on running.
18.224.62.25