Skip to content

Country

How to remotely access your Peercoin StakeBox

How to remotely access your Peercoin StakeBox

If you intend on running your StakeBox as a standalone device in the future without the need for a graphical interface through a HDMI TV/Monitor, then this section will show you how to remotely access your StakeBox.

The Raspberry Pi 3 has Wi-Fi and Ethernet network capabilities and as such we are able to remotely login to the Raspberry Pi command line from another computer on the same network. First you will need to connect to your local Wi-Fi or Ethernet router:

Wi-Fi:

When your StakeBox boots into the desktop you will see a menu bar in the upper right hand side.

 

Here you should see an icon with two red crosses on it, which indicates that the Wi-Fi is not connected to a router. Click on this icon and you should see a list of available Wi-Fi hotspots, where you should see the name of your local router.

Click on the name of your local hotspot and then enter your Wi-Fi password to connect to it. Note: your Wi-Fi SSID and password can usually be found on the back of your router or in the manual.

Ethernet:

Ethernet is as simple as connecting an Ethernet cable from your StakeBox to the back of your router. For Ethernet DHCP settings you will need to refer to your instruction manual.

SSH 

Secure shell is a method that allows us to remotely access the command line on your StakeBox. By default, and for security reasons the SSH protocol is disabled to prevent unauthorized access. In order for us to use this method you will need to enable it in the configuration menu from the desktop.

Enable SSH

  1. Launch Raspberry Pi Configuration from the Preferences menu

  1. Navigate to the Interfaces tab
  2. Select Enabled next to SSH

 

  1. Click OK

Alternatively, raspi-config can be used in the terminal:

  1. Enter sudo raspi-config in a terminal window
  2. Select Interfacing Options 

  1. Navigate to and select SSH 

  1. Choose Yes

  1. Select OK
  2. Choose Finish 

Alternatively, you can use systemctl to start the service from the terminal window:

sudo systemctl enable ssh
sudo systemctl start ssh

You may have noticed a warning message when you have logged in to the Raspberry Pi stating that the default password has NOT been changed and this is a security risk. To change the default password, you can type the following in the terminal window:

passwd 

Follow the on-screen prompts to change the password.

Setup your SSH client

You can use SSH client on almost any operating system including the following:

  • Linux/Mac OS
  • Windows
  • iOS
  • Android

Linux/Mac OS Client

You can use SSH to connect to your StakeBox from a Linux computer, a Mac, or another StakeBox, without installing additional software, making it much easier to use than other operating systems.

You will need to know your Raspberry Pi's IP address to connect to it. To find this, type ifocnfig wlan0 or ifconfig eth0 from your Raspberry Pi terminal. Next to inet you should see your IP address.

 

If you are running the StakeBox without a screen (headless), you can also look at the device list on your router. To connect to your StakeBox from a different computer, copy and paste the following command into the terminal window but replace 0.0.0.0 with the IP address of your StakeBox

ssh pi@0.0.0.0

If you receive a connection timed out error, it is likely that you have entered the wrong IP address for the Raspberry Pi.

When the connection works you will see a security/authenticity warning. Type yes to continue. You will only see this warning the first time you connect.

In the event your StaekBox has taken the IP address of a device to which your computer has connected before (even if this was on another network), you may be given a warning and asked to clear the record from your list of known devices. You can simply type in the following to clear the device replacing the IP address with that of the StakeBox:

ssh-keygen -R 192.168.0.23

Next you will be prompted for the password for the StakeBox login: on Raspbian OS the default password is raspberry, unless you have changed it in the previous section. You should now be able to see the Raspberry Pi OS prompt, which will be identical to the one found on the Raspberry Pi itself when using the graphical interface. 

If you have set up another user on your StakeBox, you can connect to it in the same way, replacing the username with your own, e.g. chris@192.168.0.2

You are now connected to the StakeBox remotely, and can execute commands from the command line.

Windows Client

On Windows you will need to download an SSH client. The most commonly used client is called PuTTY, and can be downloaded from greenend.org.uk

Look for putty.exe under the heading for Windows on Intel x86.

  1. Add your StakeBox as a host

PuTTY does not include an installer package: it is a stand-alone .exe file. When you run it, you will see the configuration screen below:

 

Type the IP address of your StakeBox into the Host Name field and click the Open button. If nothing happens when you click the Open button, and you eventually see a message saying Network error: Connection timed out, it is likely that you have entered the wrong IP address for the StakeBox.

If you do not know the IP address, type hostname -I in the Raspberry Pi command line.

  1. Connect 

When the connection works you will see the security warning shown below. You can safely ignore it, and click the 'Yes' button. You will only see this warning the first time PuTTY connects to a Raspberry Pi that it has not seen before.

You will now see the usual login prompt. Login with the same username and password you would use on the StakeBox itself. The default login for Raspbian OS is pi with the password raspberry.

You should now have the Raspbian OS prompt, which will be identical to the one found on the StakeBox. 

You can type exit to close the PuTTY window.

VNC 

Sometimes it is not convenient to work directly on the Raspberry Pi. Maybe you would like to work on it from another device by remote control.

VNC is a graphical desktop sharing system that allows you to remotely control the desktop interface of one computer (running VNC Server) from another computer or mobile device (running VNC Viewer). VNC Viewer transmits the keyboard and either mouse or touch events to VNC Server, and receives updates to the screen in return.

You will see the desktop of the Raspberry Pi inside a window on your computer. You'll be able to control it as though you were working on the Raspberry Pi itself.

VNC Connect from RealVNC is included with Raspbian OS. It consists of both VNC Server, which allows you to control your Raspberry Pi remotely, and VNC Viewer, which allows you to control desktop computers remotely from your StakeBox should you want to.

You must enable VNC Server before you can use it, by default, VNC Server gives you remote access to the graphical desktop that is running on your Raspberry Pi, as though you were sitting in front of it.

Enabling VNC Server

On your Raspberry Pi, run the following commands to make sure you have the latest version of VNC Connect:

sudo apt-get update
sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

Now enable VNC Server. You can do this graphically or at the command line.

Graphically

  1. On your StakeBox, boot into the graphical desktop.
  2. Select Menu > Preferences > Raspberry Pi Configuration > Interfaces.

 

  1. Ensure VNC is Enabled

Command line

You can enable VNC Server at the command line using raspi-config:

sudo raspi-config

Now, enable VNC Server by doing the following:

  1. Navigate to Interfacing Options.

 

  1. Scroll down and select VNC > Yes.

Connecting to your StakeBox with VNC Viewer

Direct connections are quick and simple providing you're joined to the same private local network, which your StakeBox is on. For example, this might be a wired or wireless network at home, at school, or in the office. 

  1. On your StakeBox (using a terminal window or via SSH) run ifconfig wlan0 or ifconfig eth0 to discover your private IP address.

  1. On the device you'll use to take control, download VNC Viewer. For best results, use the compatible app from RealVNC.
  1. Enter your Raspberry Pi's private IP address into VNC Viewer:


  1. When prompted enter the username and password for your StakeBox.

  1. You should now be connected and you will see your StakeBox desktop, which you can control using your computer mouse and keyboard.

Previous article How to backup and restore your Peercoin Wallet
Next article Getting Started with Peercoin StakeBox