NextCloud PI - Cannot log into command line OR SSH

Hi! I was able to get NextCloud Pi setup on a Pi 4 using the web GUI. Upon trying to set up SSH, I was getting permission denied errors for any account I tried. I then tried to login directly to the machine itself to troubleshoot with the command line interface, and couldn’t log in there, getting “this account is not available” errors.

I have no idea how to go about this, since any fixes I have found for the SSH issue involves command line access, and vice versa. Please let me know any other information I can provide. Thanks!

Which ones did you try?
Which install method or image did you use?
In terminal you should be able to login as root and/or ncp afaik.
Not enough info to go on, maybe providing some logs, could help.

Wasn’t sure how much info was needed, here goes!

The Pi is a Pi 4B, 4gb 64bit version, with my NextCloud data folder on a 4tb external hard drive. I’m accessing the web interfaces and attemtping to SSH on an M1 MacBook Pro, running Monterey 12.5.

I don’t think I can pull any logs since I can’t log in to anything, but for my install, I went off this tutorial: Own your cloud with NextcloudPi on the Raspberry Pi | Opensource.com

I used the v1.54.3 image from the NCP Girhub repository (this was the latest version when I installed a few days ago), and flashed to a 64gb SD with Belena Etcher. Then I ran through the installation wizard on the Pi’s IP address.

Accounts/Logins I have:

  • NCP Admin
  • A standard nextcloud user for myself, separate from the admin
  • Actual login info for the user interface, which is the actual pi login (ncp)
  • And then a separate password for the SSH

For direct command line access, the only login that goes through is the pi login, and I get the following error messages:

NextcloudPi v1.54.3 is outdated
update to v1.55.0 through 'ncp-config' or type 'sudo ncp-update'
Last login: Fri Sep 6 19:25:11 UTC 2024 on ttyl
No directory, logging in with HOME=/
This account is currently not available.

Armbian-unofficial 24.8.1 Bookworm ttyl

For ssh, any login I have tried gives me “Permission denied, please try again.” for the first two attempts, then “Permission denied (publickey,password).” I’ve already tried resetting the passwords and SSH status with no changes.

Suggest invalid user home directory
the linux system user ncp has no login or directory for security reasons.

You are likely root on terminal, so can run ncp-config to enable ssh for a system user of your choice except ncp and root.

How do I run ncp-config if I can’t login to any account on the machine?

The only thing I have access to is the web gui

Connect a screen and keyboard to your RPi

Yes, I know that and I’ve done it. The issue is, the only option the RPi gives me is to login, which isn’t working. It won’t let me run sudo commands because I can’t get past the login.

v1.54.0

v1.54.0 (2024-05-01) Support Debian 12 and Nextcloud 28.0.5 ===

Changes

  • Add support for Nextcloud 28.0.5
  • Add ncp-dist-upgrade script to upgrade to Debian 12 (bookworm)
  • Change mechanism to prevent root login by default
  • Add support for Raspberry Pi 5
  • Use Armbian instead of Raspbian as base for Raspberry Pi images

Take a look:
Armbian Quick Start Guide

Take this with a grain of salt – I am just an ncp user – the fastest course of action may be to reinstall. But you could also try these alternative methods of getting access to a root account on armbian (with a monitor and USB keyboard).

https://docs.armbian.com/User-Guide_Recovery/

It is odd that none of your other accounts are working? Which accounts do you expect to be able to log in (via monitor and keyboard)

Edit: alternative idea: are you able to change the password temporarily on the ncp (webadmin) user to something easy to type, and then login with keyboard/monitor with that ncp user and new password?

direct command line access, the only login that goes through is the pi login, and I get the following error messages:

NextcloudPi v1.54.3 is outdated
update to v1.55.0 through 'ncp-config' or type 'sudo ncp-update'
Last login: Fri Sep 6 19:25:11 UTC 2024 on ttyl
No directory, logging in with HOME=/
This account is currently not available

When login as pi, afaik you can use: sudo ncp-config

I assumed it would be the Pi account that I could log in with, but nothing seems to be working. Thanks for the suggestions btw, I did try the setps at the link you sent but I couldn’t even get u-boot to show up so I’m thinking it’s reinstall time.

I already had tries changing the password

For the sake of keeping this interaction going, i cannot get in when logging in as Pi. I cannot get in with any account.

If you are on Armbian the default password for root is 1234

It seems a little more complex:
NCP is configured to autologin with deactivated user root #1837

v1.54.0
see changes

So I did a full out reinstall and the exact same issues are happening.

Just to clarify, I have two the two separate logins I’m assigned at the start process: a NextCloudPi user, and a NextCloud user.

I’m assuming that I should be able to log into the pi via a keyboard adn monitor using the NextCloudPi user account, and in the web interface, this can be changed using “nc-passwd”?

I think this assumption may be incorrect. I read some documentation saying they disabled local pi-account login for security. I’m not sure if the nextcloudpi admin account works as a local login out of the box.

What I expect is that after installing, you should have at least

  • 1 nextcloud admin account
  • 1 nextcloudpi admin account (for the web panel)

In order to get local access, you may need to set up ssh access via the nextcloudpi web panel. This will have you set up an ssh user/password also. Then, even if ssh doesn’t work, I expect that you should be able to login locally (keyboard/monitor) with that ssh user.

You will also be able to use sudo and drop into a root shell with sudo -i

Let us know if this method of local login works, and the exact error messages you get if any. Best of luck!

THANK YOU!! This actually worked!

I could have sworn I tried this method previously in a moment of desperation, but it also wasn’t something I would have thought was possible anyways. I’m actually all set up on both now!

1 Like