0

I am creating virtual host on Ubuntu 14 LTS. They are working fine but I cannot grant permissions to my user. I tried the command:

sudo chown -R $USER:$USER /var/www/test.com/public_html

But I got the following:

chown: invalid group: 'admin:admin'

admin is my user I created to log with the ssh on my server. I am asking because as it is I cannot transfer file using filezilla (I log as admin). Any ideas?

additional info

id -g
100

groups
users sudo
Raphael_b
  • 185

1 Answers1

2

There you have it. Your primary group is not admin, but users (GID 100).

You can either:

  • leave the group empty (to use your primary group)
  • Use the id command to obtain your primary group or GID
  • or, as I suggested earlier, use www-data as the group, especially if you want the web server to be able to write to that directory. This is what I would recommend. See How to avoid using sudo when working in /var/www?

In order:

sudo chown $USER: ...
sudo chown $USER:$(id -gn) ...
sudo chown $USER:$(id -g) ...
sudo chown $USER:www-data ...
muru
  • 207,228