Giter Site home page Giter Site logo

fix-ssh-on-pi's Introduction

fix-ssh-on-pi

Safely enabling ssh in the default Raspberry Pi OS (previously called Raspbian) Image

This script will make some small but necessary changes to a default Raspberry Pi OS (previously called Raspbian) image.

In episode hpr2356 :: Safely enabling ssh in the default Raspbian Image I walked through the first steps of automating the update of this base image. It will:

  • Download the latest image zip file
  • Verify it is valid
  • Extract the image itself
  • Enable ssh for secure remote management
  • Change the default passwords for the root and pi user
  • Secure the ssh server on the Pi

Since then I improved the script to:

  • Enable connections to your WiFi network (default_wifi.nmconnection)
  • Load it's configuration from a ini file keeping sensitive information separate from the main script.
  • Using losetup to greatly simplify the mounting of the image.
  • Creation of a First Boot script.
  • Moved creation of the passwords and accounts to the ini file
  • Added support to select which Raspberry_Pi_OS Version to download
  • Added support set up default users using userconf.txt

This script is part of a series "Manage your Raspberry Pi fleet with Ansible" which was covered on opensource.com and on Hacker Public Radio.

fix-ssh-on-pi's People

Contributors

c650 avatar dbblackdiamond avatar derabbink avatar kenfallon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fix-ssh-on-pi's Issues

Remove xmllint from bash script

Hello Ken,
It might be helpful to remove the xmllint from the bash script as I don't believe it is included in RaspbianOS so there is a warning when running the bash script.

wpa suplicant is not working

Hello,
thanks for this nice script and thanks for sharing it, it not only fulfils a purpose, but it is also full of interesting and nice tricks.

For some reason, the WPA supplicant is not working. I have it setup with my wifi settings, it gets copied but when I put the SD on the rpizero it does not joins the network.
I checked and the wpa supplicant seems to be copied to the root of the boot partition. Is that correct? isn't it supposed to be at /etc/wpa_supplicant/wpa_supplicant.conf ?

Thanks and regards

python3 crypt not working under MacOS

Hi, I just found the repo and really like it. It is simple and looks quite clean. Sadly I found a little bug concerning MacOS:

The crypt module in python is sadly not cross platform compatible. This is explained in this post
To get this repository working under MacOS it is instead possible to use passlib (as well explained in the post mentioned).

Option to build images for rpis without eth0

Hello.
This line seems to rely on the fact that the eth0 exists:

  echo "sed \"s/raspberrypi/\$( sed 's/://g' /sys/class/net/eth0/address )/g\" -i /etc/hostname /etc/hosts" >> "${sdcard_mount}/firstboot.sh"

But there are some models, like the rpizeroW that only have wlan. It will be cool if we can pass a variable or prompt a yes/no question abut using eth0 or the wireless interface, or maybe provide a custom algorithm to generate.

Thanks

Put-pi-in-ansible-host doesn't recognize Raspberry Pi4s

I have tried using the put-pi-in-ansible-host script to discover the raspberry pi in my network and it didn't recognize the Pi4s. The reason is that Pi4s MAC addresses start with e4:5f:01, so line 50 on the script needs to be changed to include that.

Change from: grep -iE 'b8:27:eb|dc:a6:32' to grep -iE 'b8:27:eb|dc:a6:32|e4:5f:01'

is there a good way to install packages onto the image?

hey there again,

I am wondering if there is a good way to install packages onto the image so that they are reading to go when the Pi boots up. In the past I have tried chrooting, but apt is funky in chroot. I have also tried downloading the debs, but that also seems like a lot.

Have you come across any better way to do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.