-2

I'm very new to server admin. I'm having an issue whereby any file or folder I create via the terminal on WHM (Centos 7.6) results in a file/folder with 0/0 user and group stat.

Example command:

mkdir mydir

This is confirmed in Filezilla, and consequently none of the files load in the browser - I get a 500 error.

This doesn't happen when I create files/dirs directly within FileZilla. What can I do to address this?


[EDIT]

In response to Thomas' comment, the output for ls -alh mydir is:

total 0
drwxr-xr-x 2 root root  6 Aug  1 18:23 .
drwxr-xr-x 3 dev  dev  18 Aug  1 18:23 ..

while the output for ls -alh <file created earlier, not via terminal> is:

-rw-r--r-- 1 gcore gcore 9.6K Nov 28  2018 index.php
Mitya
  • 99
  • 7

1 Answers1

1

Assuming you are creating the folder mydir as user root, files and folders are created with owner and group of root.

You could either


Change the owner and group afterwards by

chown gcore:gcore mydir

Or if the folder contains files you want to use chown as follows to recursively change owner/group.

chown -R gcore:gcore mydir

Change to the user gcore and create things then

sudo -u gcore -i

or

su - gcore

Use sudo on every command

sudo -u gcore mkdir mydir
Thomas
  • 4,225
  • 5
  • 23
  • 28
  • Thank you! That solved my problem. – Mitya Aug 01 '19 at 17:39
  • Actually... while this did result in directories being created WITH users/groups, I'm still getting 500 when I try to run any files created inside of it (whether created via terminal or FZ.) Any thoughts? – Mitya Aug 01 '19 at 17:47
  • @Utkanos: I think best would be to open another question on the 500 error. – Thomas Aug 01 '19 at 17:55