2

Setup

  • Raspberry Pi outfitted with 64-bit Ubuntu Server 23.10 USB-SSD
  • MacBook and rPi are on the same LAN
  • rPi LAN IP address verified with ifconfig

Issue

  • From MacBook: ssh ubuntu@192.168.8.253 returns: Permission denied (publickey)

Procedure tested

enter image description here

  • restart SSH service: sudo systemctl restart ssh
  • attempts to login return the said error message
  • sudo systemtl status ssh returns active (running), but disabled
  • NEW: sudo systemctl enable ssh results:

enter image description here

QUESTIONS

  • What steps are needed to remedy the error?

Tests

  • sudo systemctl reload ssh did not solve the issue
  • ssh -vvvv ubuntu@192.168.8.253 > diagnostic.txt fails to pipe output to .txt file
  • Photograph of what should have been in diagnostic.txt:

enter image description here

gatorback
  • 6,523

3 Answers3

2

I had the same problem with 23.10 server (raspberry pi), setting the PasswordAuthentication yes in /etc/ssh/sshd_config didn't help.

Just looking around, I noticed there is a /etc/ssh/sshd_config.d/50-cloud-init.conf, and low-and-behold, the contents of that file contain nothing but: PasswordAuthentication yes.

I deleted that file, restarted the ssh.service and was able to login with password.

No idea if some configuration will cause that file to re-appear in the future.

teeks99
  • 312
1

These are the steps I followed to get SSH working from a remote PC to a Raspberry Pi 5 running Ubuntu 23.10

Install ssh server:

sudo apt update
sudo apt install openssh-server -y

Edit /etc/ssh/sshd_config:

PasswordAuthentication yes
PubkeyAuthentication no

Verify service is "active (running)":

sudo systemctl status ssh

Open port and/or allow ssh:

sudo ufw allow 22
sudo ufw allow ssh
yazzer
  • 111
1

Set wifi on rpi5:

sudo nano /etc/netplan/01-netcfg.yaml
network:
  version: 2
  wifis:
    wlan0:
      dhcp4: yes
      access-points:
        "your_SSID":
          password: "your_password"
      nameservers:
        addresses: [XX.XX.XX.XX, XX.XX.XX.XX]
sudo netplan apply

Set SSH:

sudo apt update
sudo apt install openssh-server -y
sudo systemctl enable ssh
sudo nano /etc/ssh/sshd_config
PasswordAuthentication to yes
KbdInteractiveAuthentication to yes
PubkeyAuthentication to no
sudo systemctl reload ssh