Cannot SSH as root into VM

renstump

New Member
Jun 4, 2023
8
1
3
6.8.12-5-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-5 (2024-12-03T10:26Z) x86_64

SSH in LXC container whether as root or user without problems.
But in VM I can only log in to SSH as a user.

In sshd_config I have removed # and changed it to:
permitrootlogin yes

Yes, I know that logging in as root should be disabled for security reasons, but I'm curios with the principle of why this doesn't work in VM, but works with LXC.

Tried latest LTS of Ubuntu Server, desktop, debian images.
 
Hi @renstump .
This is not really a PVE related question. Your inquiry is about generic Linux administration.

That said, have you restarted the sshd daemon after change? Rebooted the VM? Done any troubleshooting? I.e. increased sshd debug level and reviewed the log?
Checked that the root user actually has a password and/or ssh key generated? That it has an appropriate shell configured in /etc/passwd? Tried to increase ssh client verbosity with -v?

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: Kingneutron
Yes, security...
I have tried all possible variants

PermitRootLogin yes

PasswordAuthentication no
PermitEmptyPasswords yes

or

PasswordAuthentication yes
PermitEmptyPasswords no

or

PasswordAuthentication no
PermitEmptyPasswords no

or

PasswordAuthentication yes
PermitEmptyPasswords yes

of course always after changes:
sudo systemctl restart ssh



The fact that Ubuntu doesn't ask to create a root password during installation is new to me, which I didn't remember before. I have kept my distance from VMs for a long time.

Well, never mind. Can't log in as root, although logging in should work consistently if I change it that way but it doesn't:

PasswordAuthentication no
PermitEmptyPasswords no