Installing Home Assistant Supervised on a Raspberry Pi using Debian 12

Thanks for your reply, happy with Debian 11 for now I’ll do the in-place upgrade when required

So do I on production devices :wink:

I dont understand either. And yes, I did a full restart, just to be sure :wink:

awesome write-up! thank you!!

1 Like

An alternative to generating keys, is to add the password to the sysconf.txt file then edit the etc/ssh/sshd_config file on the other partition of the SD card/USB device (done easily in Linux by mounting it) and change:

PermitRootLogin yes

You are refering to what posting in this topic?

Sorry - pretty sure I replied to @kalemba in his post about headless install.

I really would refrain from putting that root password as cleartext on the device itself!

Furthermore setting PermitRootLogin to yes is not a good idea either.

Isn’t sysconf.txt cleared after first run?
But besides that, if you have console access then you might as well passwd root from the cli

For those of us who do not have a micro HDMI connector lying around and are trying to do this at 11:43pm when there are no shops open, it serves the purpose of being able to initially log into the system and make whatever setups we need to make to it including making it more secure.

Another thing, after first boot, the root password is removed from the sysconf.txt file so no cleartext issues with doing that. This file is reset back to defaults after first boot.

1 Like

I don’t have console access. I am doing this on another machine so when I boot the raspberry pi I can get ssh access instead of having to plug a monitor and keyboard to it (headless).

Ah yes, this is the Pi topic where one can pre-define ssh config files :). Got it confused with the Debian topic

There is a reason behind why Debian and its derivatives doesnt even have the root user activated as per default.

Take note of paragraph 1.5) of this guide. I suggest to follow the guide strictly to get the most out of your Home Assistant Supervised Installation including all of the security aspects.

If you don’t follow this guide but prefer to do the installation your own way there is little reason to post into this thread. I suggest you simply open a new thread with your guide on how to install Home Assistant Supervised on a Raspberry Pi using Debian 12.

1 Like

I think we all understand the reasoning behind that, but doing a headless installation on a remote device can be challenging without root acces :wink:

Excellent :+1:t3:

The title of that post could be: “Installing Home Assistant Supervised headless on a Raspberry Pi using Debian 12”.

and you shouldn’t even setup a root password when it prompts for one. If you DO set a root password the installation won’t install sudo and this will all end up in a world of pain for no good reason

2 Likes

Absolutely!

Like i.e. this one.

But Raspberry Pi Debian DOES have root activated when first installed. In fact, it is the ONLY user available on first boot. It just doesn’t have ssh access for root. For your reference.

AND the default root password is no password at all (yes an empty password) so by setting a password for root I am actually making it more secure!!!

As I said before, setting up the root user for first boot doesn’t mean I am not going to remove it later when I set up a secondary user. Don’t get your knickers in a knot about it!

Secondly, the OP in fact says his method is a “headless installation” so maybe the title of this post should be “Installing Home Assistant Supervised headless on a Raspberry Pi using Debian 12”. (His method is in fact not headless because you need a monitor and keyboard.)

Thirdly, the comment from @kalemba to which I originally replied already made a suggestion on an alternative method of doing headless installation and I was proposing an alternative to his/her alternative. Why is there an issue with putting my comment to that comment when his/hers didn’t receive any blowback?

Guys, can you get your facts straight before commenting. This is a RASPBERRY PI DEBIAN install. There is no issue with cleartext root password in sysconf.txt and root is activated on this OS!

Hi @DavidFW1960

After fact checking this (by installing Raspberry Pi Debian, setting up a root password, installing sudo, creating a second user and sudo-ing from that secondary user), I can confirm that your comment re “installation will not install sudo” is factually incorrect for Raspberry Pi Debian 12.

After this, of course, I removed access for the root user so that people will not comment in a huff that root has access to the system. :wink:

Nobody is opposing your findings about the root account on Debian in general.

Debian Wiki says:

At installation time, you are asked whether you want to use the root account or not.

  • If you want to (the default), you’ll be asked to provide a complex password for root. Use a strong one!
  • If not, no root account is enabled and the password of the first user created will be used for administration tasks.
  • If you forgot your root password, you first need to reset the password, then log as root (now accessible without password) and run passwd to set a new password.

However, this guide expects the user to have console access through HDMI cable, monitor and a keyboard for doing steps 1.3 to 1.5.

Obviously you deviated from this guide for certain reasons. Therefore this whole discussion about root or not root is futile within the context of the guide and thus off-topic.

1 Like