First of all, I am running the “alternative” NAS installation of the official image which is running on Synology VM manager.
It seems there are a lot of changes in recent version of HA compared to older posts here. I noticed there is no longer a “Supervisor” menu on the left hand side, but now hide in configuration. At least the function is there which is fine.
However, I am trying to create a second user, but I can not found the option in “configuration > users” as other old post pointed out. I am already an owner and also advance mode is enabled. there is no sign where this option went.
ssh: connect to host 10.0.1.32 port 22222: Connection refused
I am able to SSH into the container at port 22, but when I type command “login”, it ask for login username and password again, none of the username works. And that’s the whole reason why I tried to add a new user on the beginning of this post.
I wonder if there is any new instruction on how to adding new user and getting SSH access to host? thanks.
Is that you DO NOT type login in to SSH. As soon as you connect it asks you for your username and password. If you are are typing login, then you are telling ssh that your username is “login”
The ssh addon is a docker container (like all addons) - I do not know if the addon has any access to the users system in Home Assistant. Even if it does though, what are you trying to achieve? Please be aware that the ssh addon does not provide any access to the rest of Home Assistant - you really only get access to the /config folder.
It seems like I can get into the host by typing “login” on console, but not via SSH.
Basically, I want to access to the host via SSH session, so that I can have a better SSH client instead of using the console via a webpage. I wonder if there is any method? I saw older post asking same questions, but it seems there is no answer.
Again, this is going to depend very much on HOW you installed Home Assistant. You said it was an “alternative” install, but it’s not clear what that means. Is it running the Home Assistant OS, or is it Home Assistant Supervised running on top of something like Debian?
The install is done using this image from this link below
It’s just a image that will run under VM manager in Synology. It’s running Home Assistant OS and Assistant supervised running in a docker inside the Home Assistant OS.
OK now we are getting somewhere. It is NOT Home Assistant OS, it is Docker only. You can get inside the docker container the same way you get in to any docker container, but it’s not a full OS, it’s only what is required for Home Assistant to run.
In a terminal on your NAS, you type docker ps find the name of the Home Assistant image, it’s probably homeassistant
In a terminal on your NAS you type docker exec homeassistant -ti bash and then will start a bash shell inside the docker container and drop you in to it. That’s the best you can hope for. (Replace homeassistant with whatever the name the docker ps command returns)
It’s not running in a docker. It’s running in a VM. So, it’s a full Home Assistant OS because I need to assign how many ram, how many CPU, allocated disk space…etc for this image to run.
I eventually managed to SSH into the port 22222 on host.
For the record, this is what I did
Use a USB drive formatted with FAT, ext4, or NTFS and name it CONFIG (case sensitive)
Create an authorized_keys file (no extension) containing your public key, and place it in the root of the USB drive. File needs to be ANSI encoded (not UTF-8) and must have Unix line ends (LF), not Windows (CR LF). See Generating SSH Keys section below if you need help generating keys.
Plug the USB into the host machine (for my case it’s a synology 218+)
On the web interface of Synology, inside VM manager, edit the home assist VM, edit the VM machine, and mount the USB stick in the “other” tab.
Go to the home assistant web site, in supervisor page under system tab, there is 3 dot under the Host machine section. Click on that 3 dots and choose import USB.
The instruction page Debugging the Home Assistant Operating System | Home Assistant Developer Docs said it should now be able to use " ssh root@your_synology_ip -p 22222 " and get into host. It did NOT work for me. I tried to manually copy the SSH public key into /root/.ssh/authorized_keys on the host via Console, but it turns out the OS is mounted in READ ONLY mode.
I reboot the VM and keep the USB inside the synology, the /root magically give me write access on /root. I don’t know why, but it just did.
Go to the home assistant web site, in supervisor page under system tab, there is 3 dot under the Host machine section. Click on that 3 dots and choose import USB once again. Still won’t let me SSH into port 22222.
Reboot the VM once again and I can finally run ssh root@your_synology_ip -p 22222 and get into the host
The hardest part is to get the stupid READ ONLY mode become RW mode. For whatever reason, keeping the USB in the machine did the trick for me. I guess that USB named “CONFIG” has something do with the mounting of /root with write access
Sigh. Why not just say that then?
It’s VERY clear on the page you linked me to - there is a section dedicated to the Synology NAS ( Alternative - Home Assistant ) whereas you appear to have ignored all that and just installed a standard virtual machine, and had we known that we could have reached the solution a lot faster. Yes you have mentioned VM a few times, but you have also been trying to type login to SSH, so it’s not obvious how much computing experience you have.
The reason I am not installing the docker version because the docker version do not have the supervised process running. So that means you can’t even install HACS on that. That’s why I said at the very beginning, I am running that on a VM.
So, I am not ignoring that because I have already tried that and it didn’t work. The docker version wouldn’t let you do anything that need supervised access. In order to have a full version of HA with a proper running supervised instance and a working os-agent running on host, you have to run in VM.
@PickOne I also noticed that the “Import from USB” option doesn’t exist anymore. There is a documentation issue reported. I also couldn’t find a way to accomplish it via the ha CLI tool either and resorted manually mounting the USB stick on my RPi3 with a monitor and keyboard attached. Once I did this and copied the authorized_keys file onto my device and rebooted(take note you have to reboot,as it’s a system startup check that looks for the authorized_keys file present and enables the direct system SSH over port 22222) then I was able to SSH on port 22222.
Uuu, tell me more, tell me more
So, first, I need to make that authorized_keys file into a USB stick with a public key, as far as I know. A key which can be generated with putty and so on…
Than, I put the stick into the device, I add a keyboard, mouse and a monitor, after this… I just reboot the device and everything will be completely done? I don’t need to do anything else?
@PickOne the instructions say that if you name the USB stick CONFIG it should copy that authorized_keys file over but I had to manually mount my USB key and copy it over. That was why I had to have a keyboard & monitor on my RPi.
I have done it in other way. I just connected with putty to my home assistant, on port 22. Then I added the usb stick to my device, after this, I wrote “ha os import” which is the command to import from usb (the one which is not on UI anymore). After this, I restarted HA, then I connected to port 22222, with putty and the private key,
Now, how can I mount sda1 permanently? to have it even after restart?
I tried mount /dev/sda1 /media/hp-drive inside the addon_core_samba container, but I always get “Permission Denied”
@PickOne I was going to mention that with the keyboard attached you need to hit CTRL-ALT-F2 to get another session. However, from that ha CLI screen I’m guessing you could have executed the ha os import command as well. That was the command I was having a hard time figuring out. Nice work!