element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi Chef Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Pi Chef Design Challenge
  • More
  • Cancel
Pi Chef Design Challenge
Blog PiChef - SafeDegree Blog #3
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mark.gitsham
  • Date Created: 28 Feb 2018 9:40 AM Date Created
  • Views 282 views
  • Likes 5 likes
  • Comments 1 comment
Related
Recommended

PiChef - SafeDegree Blog #3

mark.gitsham
mark.gitsham
28 Feb 2018

Goals for this Blog

Whilst I am still waiting for a case to arrive for the Raspberry Pi3. During this blog I will be going through the installation of Raspbian on the Pi3. Configuring parts of the OS I deem both an improvement in security and person preferences. The LCD display will be installed and software setup for it to function as I need.

 

Throughout my build process, I will be using the console to configure and construct SafeDegree

 

SD-Card Initialisation

After downloading the latest Raspbian Stretch image I use Etcher to install the image on to the SD Card, using a Mac I have found Etcher to be both reliable and easy to use. Check it out here

https://etcher.io

 

Before booting the SD Card, I prefer to enable SSH. To do this I simple create an empty file named ‘SSH’ on the boot partition of the SD Card. I will use ethernet on the Pi3 so configuring the wireless settings on the Headless Pi will not be required. I will go through the procedure for enabling WiFi on a headless Pi in a later blog.

 

First Boot

Being a Headless Pi, meaning there is initially no connected Display or Keyboard / Mouse. I only connect an ethernet cable, insert the SD Card and finally connect the power. Fingers crossed the Pi lives.

 

After the Pi has booted for the first time, I always start by updating the base software. So logging in using SSH and the default username of “pi” and password “raspberry”. Followed by a reboot

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo rbi-update

$ sudo reboot

 

Display Setup

Next I need to get the display working. This proved to be quite easy. Firstly, and foremost, I decided I should probably get the manual and have a quick read through. Unfortunately when I first went to the 4DPI they were obviously experiencing technical issues and that was the end for the night. The follow day I downloaded the manual and followed the instructions and managed to have the display working in a five minutes.

 

$ sudo wget http://www.4dsystems.com.au/downloads/4DPi/All/4d-hats_4-9-35_v1.0.tar.gz

$ sudo tar -zxvf 4d-hats_4-9-35_v1.0.tar.gz -C /

$ sudo poweroff

 

Finally, I connected the display to the Pi, I used the standoffs and screws supply with the Sense Hat to help keep the display secure. And reapplied powered.

 

Yay, it worked!

image

 

 

Security Measures

To ensure I can always find my Pi, I configure it have a Static IP address.

 

$ sudo vim /etc/dhcpcd.conf

 

Scroll to the bottom of the file and insert the following two lines

interface eth0

static ip_address=192.168.100.20

 

Making sure the IP address you enter is not in use by another device on your network and is in an accessible subnet

 

Reboot, and log back in using your now static IP address.

 

Whilst you can simply change the default password, I like to create a complete new username and associated password. It just adds that little bit extra security - especially if you have you Pi connected and available to outside world.

 

$ sudo adduser mark

# Enter new UNIX password:

# Retype new UNIX password:

 

$ sudo touch /etc/sudoers.d/mark

$ sudo vim /etc/sudoers.d/mark

 

mark ALL=(ALL) NOPASSWD=ALL

 

The last couple of lines allows the new user to run sudo commands and without having to enter their password every time.

 

Next I recommend login in with the new user and checking both the ability to log in successfully and run sudo commands. Assuming all is successful, you can safely disable or delete the default pi user.

 

To disable a users account run:

$ sudo passwd pi -l

 

And to re-enable

$ sudo passwd -u

 

If you’re comfortable in not ever wanting the pi user, and have backed up any files

$ sudo userdel pi

 

Moving on, as another security addition, I utilise SSH Keys and disable password logins. Two reasons for this; firstly, it prevents password based brute force attacks and secondly it saves me having to enter a password each time I want to login using SSH.

 

To create a key pair, on my local machine (MacOS) I run

$ ssh-keygen

 

I accept the default storage location and leave the passphrase blank. Next I need to copy the public key to the Pi.

$ ssh-copy-id mark@192.168.100.20

 

Now I can login with having to enter a password. Finally, I disable password login from SSH.

$ sudo vim /etc/ssh/sshd_config

 

You will need to find the the line

#PasswordAuthentication yes

 

And change it to

PasswordAuthentication no

 

Save the file and restart the SSH service

$ sudo systemctl restate ssh

 

 

 

Conclusion

Well that is pretty much a wrap on the initial and basic setup of my Pi devices and in particular my SafeDegree Pi3 Master Controller.

 

Next time, I will begin the installation the the required software packages on the Master Controller and for those interested… in the future I will cover the configuration of Headless WiFi access - this will be based on the Pi ZeroW

  • Sign in to reply
Parents
  • genebren
    genebren over 7 years ago

    Nice post. Keep up the good work on your project.

     

    I have sat off on the sidelines with the Rpi craze until this week when my Pi Zero W arrived.  I look forward to your continuing updates on your project, and hopefully being able to follow your steps with the Pi zero W.

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • genebren
    genebren over 7 years ago

    Nice post. Keep up the good work on your project.

     

    I have sat off on the sidelines with the Rpi craze until this week when my Pi Zero W arrived.  I look forward to your continuing updates on your project, and hopefully being able to follow your steps with the Pi zero W.

    Gene

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube