Skip to content

Instantly share code, notes, and snippets.

@thedrewbisset
Last active November 20, 2016 15:58
Show Gist options
  • Save thedrewbisset/dbb2f3408a23cf22236ab9a73d760050 to your computer and use it in GitHub Desktop.
Save thedrewbisset/dbb2f3408a23cf22236ab9a73d760050 to your computer and use it in GitHub Desktop.

Secure device

passwd    # change "chip" account's password
sudo passwd -l root    # lock the root account from direct login
sudo sed -i.old /etc/ssh/sshd_config -e'/PermitRootLogin/s/yes/no/'    # configure sshd to not allow root
sudo service ssh restart

Safe shutdown

sudo systemctl poweroff

Turning on bluetooth and pairing/connecting device

$ bluetoothctl
[bluetoothctl] power on
## Turn on keyboard if it's been paired

[bluetooth] pair [device-id]
[bluetooth] connect [device-id]
[bluetooth] trust [device-id]

setup dynamic hostname for ssh

Add the following to /etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

Next, reconfigure the hostname and hosts files (/etc/hostname /etc/hosts) and change chip to desired hostname

Then restart the avahi daemon: sudo /etc/init.d/avahi-daemon restart

generate keys for ssh access

sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
sudo ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment