Can't access config.php, cant use root, sudo not working

Still learning…
Set up a VM on my NAS, using a prebuilt OVA Nextcloud which I purchased.
Everything is working great, can see it on lan IP, can also access remotely.

However, I need to add the remote IP as a trusted domain… this is where I get stuck.
Using ncadmin on SCP, i cant access the folder of Nextcloud as im locked out…

So I added a root password, yet root wont let me login at all… so it seems ncadmin should be the root user… but im guessing its just sudo… but sudo isnt really much help over SCP.
As its a VM, I cant access the files any other way…

Kinda at a loss…
Maybe a feature request for the future… allow admin users to add trusted domains via the control panel…

As I just seem to be unable to do this otherwise…

Still learning SSH commands, so happy to do it over that, but would prefer not to as I really dispise text editing over SSH… its painful.

Any help greatly appreciated.

I do not fully understand your setup or access?

Does ncadmin have ssh access and sudo rights.

you can add a trusted domain several ways then.
for example create a trusted.config.php in your NC config dir containing

<?php
$CONFIG = array (
    'trusted.domains' => array (
         1 => 'your.example.tld',
  ),
);

seems after rereading you need ssh instructions.
Why is text editing a pain over ssh isn’t it the same as local ?

Using my favorite editor nano you can go up left and right with arrows and save with ctrl+o and exit with ctrl+x what more do you need to edit one line.

ssh ncadmin@serverIP

edit using sudo add your trusted domain you can cut and paste with ctrl+shift+c (copy) ctrl+shift+v (paste)

sudo nano /var/www/NC-INSTALL-DIR/config/config.php

not using nano create the file locally and copy to ncadmin homedir then copy the file to NC-INSTALL-DIR/config

copy above and save as trusted.config.php

scp trusted.config.php ncadmin@serverIP

or

cat trusted.config.php | ssh ncadmin@serverIP 'cat > trusted.config.php'

then ssh into server and adjust rights and copy

ssh ncadmin@serverIP

then change the ownership to the webserver user as example here ‘www-data’

sudo chown www-data:www-data trusted.config.php

and copy it

sudo -u www-data cp trusted.config.php /var/www/NC-INSTALL-DIR/config/

Hope this helps you create your file