Last update: 5/18
Just use nmtui
.
On recent ubuntus (16.04+) with the new net interfaces mac rename thingy, disable it to get back to the old naming scheme with:
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
ln -s /dev/null /etc/udev/rules.d/73-usb-net-by-mac.rules
On Ubuntu and Raspbian:
sudo apt-get install wpasupplicant
wpa_passphrase SSID PASSW > wpa.conf
If /etc/wpa_supplicant.conf or /etc/wpa_supplicant/wpa_supplicant.conf do not exist:
sudo cp wpa.conf /etc/wpa_supplicant.conf
Or append to the existing file:
sudo cat wpa.conf >> /etc/wpa_supplicant.conf
Check that the interface is working:
ifconfig wlan0 up
iwlist wlan0 scan //both should work
Edit /etc/network/interfaces, append this or edit to make wlan0 auto and dhcp:
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf
Try to connect manually or restart:
sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B //it should work (add -D wext for nl80211 adapters)
dhclient -r ;dhclient wlan0
sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh
If the last command gives key errors on Raspbian just delete the keys under /etc/ssh/ssh_host_* and:
sudo service ssh restart
To create new ones in one go.
systemctl set-default multi-user.target --force
systemctl disable lightdm.service --force
systemctl disable graphical.target --force
systemctl disable plymouth.service --force
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales