Solved Command line fun 'n' games

Currently reading
Solved Command line fun 'n' games

137
19
NAS
DS918+
Operating system
  1. macOS
Mobile operating system
  1. iOS
I need to edit a config file in /volume1/docker/nextcloud/config so I've SSH'd in as 'nasadmin' cos I don't know the root user's password (should I?).

I want to firstly copy the config.php file as config-original.php in case it all goes wrong then edit a couple of lines.

Here's the contents of the config directory


Code:
drwxrwxrwx+ 1 33 root   300 Jun 13 23:50 .
drwxrwxrwx+ 1 33 root   412 Jun 13 23:05 ..
-rw-r--r--  1 33 root    60 Jun 13 23:05 apache-pretty-urls.config.php
-rw-r--r--  1 33 root    70 Jun 13 23:05 apcu.config.php
-rw-r--r--  1 33 root   377 Jun 13 23:05 apps.config.php
-rw-r-----  1 33   33   979 Jun 13 23:50 config.php
-rw-r--r--  1 33 root 55973 Jun 13 23:05 config.sample.php
-rw-r--r--  1 33 root   495 Jun 13 23:05 .htaccess
-rw-r--r--  1 33 root   476 Jun 13 23:05 redis.config.php
-rw-r--r--  1 33 root   674 Jun 13 23:05 reverse-proxy.config.php
-rw-r--r--  1 33 root   669 Jun 13 23:05 smtp.config.php

Maybe a side issue but the first thing that jumps out is that config.php is in the group '33' whereas every other file here - and all the other files in the other directories for the Nextcloud data are 'root'. Is this a potential problem? I don't think so but have I inadvertently changed the group?

So, I'm hard, I know how to use Terminal on me Mac. All I need say is:
Code:
[email protected]:/volume1/docker/nextcloud/config$ cp config.php config-original.php
But...
Code:
cp: cannot open ‘config.php’ for reading: Permission denied
So either I want to be logged in as root - in which case where do I find the password - or can I 'sudo'?
Code:
[email protected]:/volume1/docker/nextcloud/config$ sudo cp config.php config-original.php

What could possibly go wrong?! 🤔
 

Rusty

Moderator
NAS Support
2,486
746
www.blackvoid.club
NAS
DS412+, DS718+, DS918+, 2x RS3614RPxs+ with expansions
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Just elevate your login as root using sudo -i, enter your nasadmin pass again and you will have root access. Then continue on.
 
137
19
NAS
DS918+
Operating system
  1. macOS
Mobile operating system
  1. iOS
Done that then! Thanks for the tip @Rusty. I then discovered there's no Nano so had to use Vi to add "nextcloud.mydomain.tld" to the Trusted Domains section.

And it works :D
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top