How to install nano to edit configuration file

Hello, I want to change the default SSH port for security reason.
With previous raspbian version, with putty, I edit the configuration file with the command :
But in Hass.io, nano is not install, and sudo not working.
So I want to install nano to edit files. Is that the good way ? How to do that ?
Thank for your help

Sylvain

apk update
apk add nano

Great, it’s working, tks.
Last question, why nano is not include in hass.io, will it be deprecated ?

why? “command not found”

1 Like

How to install nano in HAOS 5.2?
I’m connected to Pi physically (monitor+keyboard).
I assume I jump out from ha cli to OS shell using login. Now what? apk comman doesn’t exist.

Does anyone an idea to install nano in the root shell?

$ ssh -p 22222 root@raspberry
 _    _                                         _     _              _   
| |  | |                          /\           (_)   | |            | |  
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_ 
|  __  |/ _ \| '_ ` _ \ / _ \   / /\ \ / __/ __| / __| __/ _` | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_ 
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|
                                                                         
Welcome to the Home Assistant command line.

For more details use 'help' and 'exit' to close.
If you need access to host system use 'login'.

ha > login
# nano
/bin/ash: nano: not found
# apk
/bin/ash: apk: not found
# apt install nano
/bin/ash: apt: not found

AFAIK the HAOS is not your regular (full) linux, so there’s no nano nor apt nor apk - it’s a locked down minimal appliance OS and thus you cannot really install things onto your HAOS.

apt update
apt install nano
apt install mc

If you want to change stuff in HAOS, I use “vi” , I change stuff in HAOS to load extra kernel modules for example…

1 Like

Apt doesn’t work, not sure why you are posting this

1 Like

art works fine only HAOS cleans all installations in the system

There is no APT in HAOS, buildroot doesnt have any package managers…
apt only works in the containers, those are based on alpine

first you need to check … you are a storyteller :-1:

1 Like

hmm:

1 Like

You are not running HA OS, but debian.

image

Probably a venv install

1 Like

Ah storyteller :slight_smile:

1 Like

doc
:rofl:

For the SSH addon just list nano to apks in its config. Then you don’t have to remember to re-rerun apt update && apt install nano every time the addon updates or restarts. Or if you use the SSH addon from the community repo, add nano to packages, same thing.

As noted above you cannot install nano on the host for use in the root shell. There is no package manager available by design. You also really shouldn’t change things there but if you need to then use vi.

1 Like

Ah, I wasn’t aware that you can include packages in the addon, that’s indeed usefull, I always need to add the tool with apk command on every restart…

Thnx for that info :+)