0

I am trying to form a group with two users so that only those two users have access to a directory using

chmod g+r dir

I form a new group, www-OtagoHarbour, and try to add an existing user, OtagoHarbour, like this.

OtagoHarbour@WebServer:/var/www/executables$ sudo groupadd www-OtagoHarbour
OtagoHarbour@WebServer:/var/www/executables$ sudo useradd -G www-OtagoHarbour OtagoHarbour
useradd: user 'OtagoHarbour' already exists
OtagoHarbour@WebServer:/var/www/executables$ sudo useradd -g www-OtagoHarbour OtagoHarbour
useradd: user 'OtagoHarbour' already exists

Of course the user 'OtagoHarbour' exists but I want to add it to a group with another user.

1
  • 1
    You will also want to give them x perms on directories.
    – jordanm
    Commented Jan 22, 2014 at 4:41

1 Answer 1

3

You use the command useradd to add accounts. But once they've been created you use the command usermod to modify them.

$ usermod -a -G www-OtagoHarbour OtagoHarbour

References

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .