Last active
February 19, 2021 17:02
-
-
Save Saka7/bc2b88f9b5f748a46e88af83fafcd216 to your computer and use it in GitHub Desktop.
Nanopi duo2 - headless ssh setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download http://download.friendlyarm.com/nanopiduo2 | |
# Unzip | |
# Flash image to sd-card | |
lsblk -p | |
mkfs.vfat /dev/sd* | |
dd if=./*.img of=/dev/sd* bs=4M conv=notrunc status=progress | |
# Configure wpa_supplicant | |
sudo vi ./etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="<WIFI SSID>" | |
psk="<WIFI PASSWORD>" | |
proto=RSN | |
key_mgmt=WPA-PSK | |
pairwise=CCMP | |
auth_alg=OPEN | |
} | |
sudo vi ./etc/network/interfaces | |
auto wlan0 | |
allow-hotplug wlan0 | |
iface wlan0 inet dhcp | |
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf | |
iface default inet dhcp | |
sudo touch ssh | |
# Find device local ip | |
nmap -sS -p 22 192.168.0.1/24 | |
DEFAULT_USERNAME=pi | |
DEFAULT_PASSWORD=pi | |
USER=saka7 | |
NANOPI_HOST=192.168.0.104 | |
ssh $DEFAULT_USERNAME@$NANOPI_HOST | |
# Setup | |
sudo apt update && sudo apt upgrade -y | |
sudo apt install curl tree htop lnav -y | |
sudo useradd $USER | |
sudo usermod -aG sudo $USER | |
sudo mkdir /home/$USER | |
sudo chown -R $USER:$USER /home/$USER | |
sudo passwd $USER | |
sudo usermod -s /bin/bash $USERNAME | |
sudo update-alternatives --config editor | |
mkdir -p ~/.ssh | |
echo "<SSH PUBLIC KEY>" > ~/.ssh/authorized_keys | |
Author
Saka7
commented
Jun 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment