adamoutler / HassOSConfigurator

A set of Add-Ons to configure HassOS For various platforms and development purposes.
180 stars 43 forks source link

SSH Configurator not working on Odroid N2+ #10

Closed marcvl64 closed 2 years ago

marcvl64 commented 2 years ago

When trying to ssh, I'm getting error "Connection Refused".

These are the log entries:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
no vda1 config found
no sda1 config found
no sdb1 config found
no mmcblk0p1 config found
no nvme0n1p1 config found
This Configurator did it's job. Perform a hard-power-off now. This configurator only works once and is no longer needed.

and these are the disk mounts:

[core-ssh mnt]$ df -aTh
Filesystem           Type            Size      Used Available Use% Mounted on
overlay              overlay        56.6G      9.5G     44.8G  18% /
proc                 proc               0         0         0   0% /proc
sysfs                sysfs              0         0         0   0% /sys
tmpfs                tmpfs           1.9G         0      1.9G   0% /sys/fs/cgroup
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/systemd
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/cpuset
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/net_cls,net_prio
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/blkio
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/pids
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/devices
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/perf_event
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/freezer
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/hugetlb
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/memory
cgroup               cgroup             0         0         0   0% /sys/fs/cgroup/cpu,cpuacct
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /data
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /share
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /ssl
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /addons
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /backup
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /media
devtmpfs             devtmpfs        1.7G         0      1.7G   0% /dev
tmpfs                tmpfs           1.9G         0      1.9G   0% /dev/shm
devpts               devpts             0         0         0   0% /dev/pts
hugetlbfs            hugetlbfs          0         0         0   0% /dev/hugepages
mqueue               mqueue             0         0         0   0% /dev/mqueue
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /config
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /run/audio
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /etc/asound.conf
tmpfs                tmpfs         763.5M      1.4M    762.1M   0% /run/dbus
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /etc/hosts
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /etc/resolv.conf
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /etc/hostname
tmpfs                tmpfs           1.9G         0      1.9G   0% /dev/shm
/dev/mmcblk1p4       ext4           56.6G      9.5G     44.8G  18% /etc/pulse/client.conf
proc                 proc               0         0         0   0% /proc/bus
proc                 proc               0         0         0   0% /proc/fs
proc                 proc               0         0         0   0% /proc/irq
proc                 proc               0         0         0   0% /proc/sys
proc                 proc               0         0         0   0% /proc/sysrq-trigger
tmpfs                tmpfs           1.9G         0      1.9G   0% /proc/asound
devtmpfs             devtmpfs        1.7G         0      1.7G   0% /proc/keys
devtmpfs             devtmpfs        1.7G         0      1.7G   0% /proc/timer_list
tmpfs                tmpfs           1.9G         0      1.9G   0% /sys/firmware
adamoutler commented 2 years ago

Well, looks like somehow you're booting from mmcblk1p0 instead of 0p0. Can you swap the drives? How common would you say this configuration is?

marcvl64 commented 2 years ago

I don’t think I can change this. This is the standard Odroid N2+ server preconfigured for HA. It comes with an embedded 64g eMMC drive.

It’s pretty popular since its the basis for the Home Assistant Blue hardware.

anduchs commented 2 years ago

Same problem I have in #8 I guess I just messed up ODROID and BPI... ;-)

marcvl64 commented 2 years ago

Is it easily fixable?

marcvl64 commented 2 years ago

I noticed you made some changes (comment in #8). I uninstalled and reinstalled but it's still not working. I noticed a few extra lines in the logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
no vda1 config found
no sda1 config found
no sdb1 config found
no mmcblk0p1 config found
no mmcblk1p1 config found
no nvme0n1p1 config found
This Configurator did it's job. Perform a hard-power-off now. This configurator only works once and is no longer needed.
adamoutler commented 2 years ago

It didn't find a config in mmcblk1p1. Can you do this from a terminal with proper permissions? You'll need to enable dangerous permissions to do this. I would like the output from a terminal of these commands.

You can paste the results to pastebin.adamoutler.com then hit ctrl-s and copy the url in the address bar here.

mkdir /tmp/0;
mkdir /tmp/1;
mkdir /tmp/2;
mount /dev/mmcblk1p0 /tmp/0;
mount /dev/mmcblk1p1 /tmp/1;
mount /dev/mmcblk1p2 /tmp/2;
ls -alR /tmp/0;
ls -alR /tmp/1;
ls -alR /tmp/2;

If this fails, try -alr instead of -alR. Awaiting response.

marcvl64 commented 2 years ago

here it is:

https://pastebin.adamoutler.com/CZYnxQINKy74WOCJ

None of the mounts worked. From my previous df, the external device is /dev/mmcblk1p4. Strangly enough, when I do another df, it shows me /dev/mmcblk0p4 as the external device. Not sure how or why it changed. When i tried to mount mmcblk0p1 or mmcblk0p2 it gives me error 'permission denied'. The system doesn't seem to have 'sudo' installed.

adamoutler commented 2 years ago

Looks like something went wrong with the first mount. Can you try that mkdir and mount again?

marcvl64 commented 2 years ago
mkdir: can't create directory '/tmp/0': File exists
mkdir: can't create directory '/tmp/1': File exists
mkdir: can't create directory '/tmp/2': File exists
mount: mounting /dev/mmcblk1p0 on /tmp/0 failed: No such file or directory
mount: mounting /dev/mmcblk1p1 on /tmp/1 failed: No such file or directory
mount: mounting /dev/mmcblk1p2 on /tmp/2 failed: No such file or directory

The /dev/.... files you specify above do not exist on my system. The files are all /dev/mmcblk0px with x from 1 to 9.

adamoutler commented 2 years ago

No. In your first post you showed mmcblk1p4 is your data partition. Are you changing your configuration?

marcvl64 commented 2 years ago

I know, that's pretty weird. I didn't change my configuration. But somehow the names of these files have changed. I don't understand how that's possible.

adamoutler commented 2 years ago

Did you disable Protection Mode in the terminal app?

marcvl64 commented 2 years ago

No. I don’t even know what that is :)

adamoutler commented 2 years ago

This. Do this and try again. Screenshot_20210930-072354

marcvl64 commented 2 years ago

Ok, tried that. Still getting 'connection refused'. The log looks like this:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
no vda1 config found
no sda1 config found
no sdb1 config found
creating authorized keys in mmcblk0p1 !
no mmcblk1p1 config found
no nvme0n1p1 config found
This Configurator did it's job. Perform a hard-power-off now. This configurator only works once and is no longer needed.
adamoutler commented 2 years ago

You'll be fine after a reboot. It may take 2 full power-off-power-on reboots. It's done though and working properly.

On Thu, Sep 30, 2021 at 2:05 PM marcvl64 @.***> wrote:

Ok, tried that. Still getting 'connection refused'. The log looks like this:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. no vda1 config found no sda1 config found no sdb1 config found creating authorized keys in mmcblk0p1 ! no mmcblk1p1 config found no nvme0n1p1 config found This Configurator did it's job. Perform a hard-power-off now. This configurator only works once and is no longer needed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adamoutler/HassOSConfigurator/issues/10#issuecomment-931546138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEA4L2UGS475MKYTA6P3ZDUESREXANCNFSM5EUSIXEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

marcvl64 commented 2 years ago

you are right. I forgot to reboot. Everything worked after reboot. Thanks so much!

One add'l question: if I want to add another computer to the approved list, can I run your add-on again with a different key?

adamoutler commented 2 years ago

I think that worked at one point but no longer. You can try putting \n.

marcvl64 commented 2 years ago

Since i have root access with 1 computer, I used that one to manually edit /root/.ssh/authorized_keys and add the second key. Everything works great. Thanks so much for your help.