ubuntu 20-10 running on the RPi4b
https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi
edit network-config file in system-boot partition on SD card, e.g.
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"home network":
password: "123456789"
Power up the pi, wait until all green LED activity ceases, then reboot, the pi should now auto-connect to the wifi network using seed credentials supplied going forward.
The default login username is "ubuntu", password is "ubuntu". You will be asked to change the password on first login - this is good, but better still will be to create a new user, then delete the default user (ubuntu).
# create new user xxx
$ sudo adduser xxx
# add user xxx to sudo group, allowing them to execute sudo and launch as root
$ sudo usermod -aG sudo xxx
logout default user, login with new user
# edit /etc/passwd and change default shell for user xxx from /bin/sh (default shell) to bin/bash (bash)
# delete default user ubuntu, with their home directory
$ sudo userdel -r ubuntu
Some images come with ssh-daemon installed, configured and running by default, otherwise:
# install sshd os package
$ sudo apt install openssh-server
# confirm that sshd is installed and running:
$ sudo systemctl status ssh
sample output:
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-02-04 11:27:09 SAST; 3h 40min ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 879 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 900 (sshd)
Tasks: 1 (limit: 4135)
CGroup: /system.slice/ssh.service
└─900 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
Feb 04 11:27:09 djinn systemd[1]: Starting OpenBSD Secure Shell server...
Feb 04 11:27:09 djinn systemd[1]: Started OpenBSD Secure Shell server.
Feb 04 11:27:09 djinn sshd[900]: Server listening on 0.0.0.0 port 22.
Feb 04 11:27:09 djinn sshd[900]: Server listening on :: port 22.
# open a hole in the firewall for SSH port (22)
$ sudo ufw allow ssh
From an alternative machine on the same network:
# connect to a host with IP address a.b.c.d as user xxx
$ ssh a.b.c.d -l xxx
or:
$ ssh [email protected]
# update the package manager with the information about the latest packages
$ sudo apt update
# upgrade all packages on the machine
$ sudo apt upgrade
# list network interfaces
$ ifconfig -a
# bring wifi interface xxx up
$ sudo ifconfig xxx up
# take wifi interface xxx up
$ sudo ifconfig xxx down
# generate WPA2 PSK file for SSID network_ssid and pre-shared-key network_key
# and store in file the_network.conf in file location /etc/wpa_supplicant/
$ wpa_passphrase network_ssid network_key > /etc/wpa_supplicant/the_network.conf
$ sudo cp wpa_supplicant.conf /etc/wpa_supplicant/the_network.conf
# connect to WPA2 PSK-protected network on interface xxx
# using connection config file /etc/wpa_supplicant/the_network.conf
$ sudo wpa_supplicant -ixxx -c/etc/wpa_supplicant/the_network.conf -Dwext
# establish connnection and run as background process, echoing to standard out
$ sudo -B ...
# launch DHCP client to obtain IP from DHCP server on network interface xxx
$ sudo dhclient xxx
# all in one
$ sudo wpa_supplicant ... & sudo dhclient ...
====
# scan for list of networks
$ nmcli d wifi list
sudo apt-get install openssh-server (pre-installed)
2nd Wifi
from the RealTek website:
The Realtek RTL8192EU-VL-CG is an 802.11bgn 2.4G single-chip that integrates Wireless LAN (WLAN) and a network USB interface (USB 1.0/1.1/2.0 compatible) controller. It combines a WLAN MAC, a 2T2R capable WLAN baseband, and WLAN RF in a single chip. The RTL8192EU-VL-CG provides a complete solution for a high-throughput performance and low power consumption integrated wireless LAN device.
from the MediaTek website:
MediaTek MT7601U is a highly integrated Wi-Fi single chip that's fully compliant with 802.11b/g/n standards (150Mbit/s PHY), offering feature-rich, reliable and cost-effective wireless connectivity from an extended distance.