SOLVED Edit config.php in Nextcloud pod shell

fabianm

Dabbler
Joined
Apr 15, 2023
Messages
11
Hi,

I locked my admin out of Nextcloud by enforcing 2fa.
In the config/config.php file, I can see that 'twofactor_enforced' => 'true' and twofactor_enforced_groups' => array 9( 0 => 'admim,) is set.

I tried editing the config.php file by opening a Pod shell in the Nextcloud container with: vi, nano, edit, ee, but it seems there is no editor installed in this container. What is the approach to do this?

[EDIT]: I installed vim in the container to edit the file. Is this advised, or should I use a different method?

Best Fabian
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Don't do or edit anything in a container that you don't want to lose at some point (you will lose it, just a question of when the container is redeployed).

If you need to be able to edit the file, you need to look at storage and persistence and make sure that file or the directory that contains it is actually mounted to the right place in the container from a location on your host, then edit the file on the host, not in the container.
 

fabianm

Dabbler
Joined
Apr 15, 2023
Messages
11
Don't do or edit anything in a container that you don't want to lose at some point (you will lose it, just a question of when the container is redeployed).

If you need to be able to edit the file, you need to look at storage and persistence and make sure that file or the directory that contains it is actually mounted to the right place in the container from a location on your host, then edit the file on the host, not in the container.
TY for the reply, I understand that this is the case since it is inside the running container. In that regard, it makes sense that there is no editor installed.

Since I only need to change the setting temporarily to get access to my admin account and set 2factor correctly, I am ok with that.
Just wanted to make sure I don't blow up my install

Best
 
Top