Can't enable SSH via ncp-web

Hi! And thanxxx for the superb project I discover!

I installed nc28 on a raspberry pi4 from ncp 1.54.0 image, but can’t enable and succeed an ssh connection.

From the web admin https://192.168.1.7:4443/?app=SSH, I changed the pi passwd (makes sense!), but despite the encouraging conclusion “SSH enabled”, there were errors that apparently prevent my logging in, with the error:

~ ssh pi@192.168.1.7
ssh: connect to host 192.168.1.7 port 22: Connection refused

My local network does allow ssh, which I succeeded on the same rbp under Ubuntu (only a different address 192.168.1.23).

I tried to create empty files /ssh and /boot/ssh, but it didn’t help.

I updated to ncp1.54.2, no help either.

My let’sencrypt config is not functional (still producing the autosigned rbpi certificate), but this should not cause problems in the local network, should it?

Any idea what I could try? Here is the log of https://192.168.1.7:4443/?app=SSH:

[ SSH ] (Fri Jun 7 07:19:26 UTC 2024)
pi exists, changing password
New password: Retype new password:
passwd: password updated successfully
Enabled sudo for pi
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xeu ssh.service" for details.
SSH enabled

PS: I tried installing nc on my previous raspbian install, where I did have SSH to start with, but got confused in the settings and not make it till the end. Thanks to this great ncp project, I have a working server, but some administration need SSH, like proper email configuration…

You need access to a cli to check ssh.service

pi@nextcloudpi:~ $ sudo systemctl status ssh.service
â—Ź ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; preset: enabled)
     Active: active (running) since Fri 2024-05-03 20:56:22 CEST; 1 month 4 days ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 744 (sshd)
      Tasks: 1 (limit: 3932)
        CPU: 11.467s
     CGroup: /system.slice/ssh.service
             └─744 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Thanks @geoW ! But this is precisely my problem: how do I access cli without ssh? I could of course attach a keyboard and screen, but I thought there would be a way without that… isn’t this precisely the main advantage of ncp images?

Nice, that’s the easiest way to see what’s going on.

The main advantage of RPI and similar boards is the presence of UART
No additional monitor or additional keyboards are needed. :rofl:

Come on, we got an error message and a proposal to handle it

We received an offer to read the system log. Perhaps there will be a hint why the ssh service is not working :innocent:

Imagine we could discover, starting/restarting the service would be an option to proceed.

By the way, personally, I would first simply take out the flash drive, mount it in any convenient and existing OS and see what is missing for successful ssh operation

Sure a viable option, but inspecting a running system to me seems here the better option, but to the beginning, we need access to a cli
(Meanwhile the monitor and keyboard could be connected :grinning:,)

We should keep in mind, the new images are armbian based.
How to login?

Please don’t fight! @zdv : starting UART requires… cli !!!
Verdict:

sshd. no hostkeys available -- exiting.

I suppose I will manage from here.
But this should ideally be done automatically when turning on ssh with https://nextcloud.local:4443/?app=SSH , no?

Because here I went through the painful process: getting a long ethernet cable (since I have no wifi, and no ethernet plug close to my hdmi TV), discover my french keyboard isn’t recogniwed, chqnge the pqsszd viq the qpp.SSH so I cqn type it successfully before the ti;e=out… Having a hard time reading me? Normal I’m blindly typing on the wrong keyboard: imagine typing a password in these conditions!!!

Solution was:

$ cd /etc/ssh
$ sudo ssh-keygen -A
$ /etc/init.d/ssh start

Then select user pi, and type its passwd. WOOOOF!

Oh yeah, even with nose at screen I doesn’t succeed 100%.
So. if you start again, maybe taking image 1.53.3 the last with raspianos is easier to setup, because, if you write the image with raspiimager you can do setups before writing.

Thx for the suggestion. But I guess ssh-keygen can only be done AFTER install, not BEFORE writing the image, right?

I was thinking: maybe I got trapped because I didn’t find a step-by-step install guide: 'took me a long time to understand I had to connect the RBPi to Ethernet, for instance…

So while try and error, I created another user than pi… and maybe this is what screwed the app=SSH procedure, which I suppose must work at least for some people?..

Maybe, btw we are talking about rpi 4, do we?
SSH works very good, I can’t remember any difficulties to get it working when I set up my ncpi, therefore my suggestion taking an “older” image. There you are able to select ssh in the imager, preconfiguere other settings - or do the ssh file-thing.
I’m afraid, ssh is not running on yours now.
Take another card with older image, go to a friend where you can do first boot and setup under better conditions.