So folks…i am trying to help a fellow maker trying to get his setup running on HA.
Having copied/imported/setup the authorized_keys file on HASSOS you’ll see that i need to run “login” to get to an SSH prompt. Please note that i have applied all the available OS patches, updates.
pi@SmartiPi1:~ $ ssh [email protected] -p 22222
_ _ _ _ _
| | | | /\ (_) | | | |
| |__| | ___ _ __ ___ ___ / \ ___ ___ _ ___| |_ __ _ _ __ | |_
| __ |/ _ \| '_ ` _ \ / _ \ / /\ \ / __/ __| / __| __/ _` | '_ \| __|
| | | | (_) | | | | | | __/ / ____ \\__ \__ \ \__ \ || (_| | | | | |_
|_| |_|\___/|_| |_| |_|\___| /_/ \_\___/___/_|___/\__\__,_|_| |_|\__|
Welcome on Home Assistant command line.
For more details use 'help' and 'exit' to close.
If you need access to host system use 'login'.
ha > ls -la
Error: unknown command "ls" for "ha"
Did you mean this?
cli
dns
os
Run 'ha --help' for usage.
FATA[0000] Error while executing rootCmd: unknown command "ls" for "ha"
Did you mean this?
cli
dns
os
ha > login
# ls -la
drwx------ 4 root root 42 Apr 16 00:45 .
drwxr-xr-x 13 root root 210 Apr 16 02:15 ..
drwxr-xr-x 2 root root 1024 Dec 21 2018 .docker
drwxr-xr-x 2 root root 1024 Jun 6 22:15 .ssh
#
@tangowhisky37 I think you are doing fine. I don’t even see a question there(?). The “prompt” you are referring to is shell (ash) prompt while SSH is a protocol you are using to communicate with your system.
I see you have .ssh directory there as well. Assuming you have the “authorized_keys” file in place and it contains one or more public keys you may be establishing connection using the rsa key pair instead of password authentication. Please note the access permissions for the directory .ssh (700) and authorized_keys (500). sshd and especially vsftpd may be rejecting keys which are writable by others than owner. (My recent painful experience on CentOS ).
This generated the public key again. I then pasted it into notepad++ after having set the new document properties (SETTINGS>>PREFERENCES>>NEW DOCUMENT) to ANSI and UNIX/OSX
The difference to previous is the key was one long line now. I couldn’t even scroll to the end of it but it was all there. I uploaded this and it worked. Tedious!
I had the same problem.
I am going to summarize what helped because it is a mix of everything stated here. It might be a documentation overkill but I hope I can help anyone with this.
What did the trick was following (With Windows):
Be sure to have notepad++ installed
change the preferences to following:
in Notepad go to file -> Save as and change the filetype to All types and change the filename to authorized_keys
Otherwise notepad++ will save it as authorized keys.txt
7.safely remove the USB drive from your PC and put it into your Home assistant machine.
Open your Home assistant through the browser and go to Supervisor - System -> import from USB
open Putty
Type in the Hostname and Port 22222
Select the private key we generated before and open.
If you have the SSH add-on installed and working, you should also be able to use your favorite SFTP utility to copy files to the /config (or other) share. The SAMBA add-on also works.
I also had to edit my private key and change the end of line from the windows default to (LF). You may want to edit your detailed directions to add this.
Strange. I was able to ssh into the host using ssh [email protected] -p 22222 but when I logged out using exit and tried to do exactly the same again I got
Error response from daemon: stat /mnt/data/docker/overlay2/f65e25c6430b7bc1be3d5fc90452a1b359f4ff2a88933ad9db4b6c2840ac21fa: no such file or directory
Is there a way to connect directly to ash shell?
With old ResinOS I was able to use WinSCP to browse filesystem and edit file within addon’s containers. Now I was able to connect to 22222 with putty but I need to issue a “login” command before gain access to ash shell…
WinSCP connections fails because don’t recognize command interpreter
I can’t get this to work. I have followed this guide to the letter, but I only get connection refused.
I cannot for the life of me understand what I’m doing wrong.
The logs doesn’t tell much either.
I see this, but that’s it:
21-03-03 09:35:10 INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.ADD usb hardware /dev/bus/usb/001/011
21-03-03 09:35:26 INFO (MainThread) [supervisor.hassos] Synchronizing configuration from USB with Home Assistant Operating System.
21-03-03 09:35:26 INFO (MainThread) [supervisor.host.services] Restarting local service hassos-config.service
I can’t get it to work. authorized_keys file is there, transfered it with WinSCP to root folder and then used mv command to move it to .ssh (via Terminal SSH addon). Putty always returns Connection Refused error. Import from USB button doesn’t seem to do anything.
I’m struggling with this problem too. I followed the instructions but got the same problem as @pepeEL. I have created manually the authorized_keys files with SSH & Terminal Addon since the Import From USB method seems to do nothing at all (tried NTFS, FAT and FAT32 formats).
Warning: Permanently added ‘[192.168.1.4]:22222’ (ECDSA) to the list of known hosts.
Load key “/root/.ssh/id_rsa”: invalid format [email protected]: Permission denied (publickey).