Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question [solved] chown: invalid user problem

    hi all... this is my first time here, hopefully not the last...

    i have a problem with changing file permissions on ubuntu server 10.10

    i was installing asterisk 1.8 to the system. for that i created a user named asteriskpbx and added a group named asteriskpbx under sudoers file. added the user to the group in the group and gshadow files..

    after that, tried:

    $ sudo chown -R asteriskpbx:asteriskpbx /usr/lib/asterisk/

    which returned something like:

    chown: invalid group something something... (i really dont remember)

    after seeing that, i thought maybe users and groups should have different names and changed the asteriskpbx group' s name to pbx in the gshadow, group and sudoers files.

    now the command:

    $ sudo chown -R pbx:asteriskpbx /usr/lib/asterisk/


    chown: invalid user: `pbx:asteriskpbx`

    what should i do to solve this...

    thanks in advance...
    Last edited by ysuluhan; 08-18-2011 at 02:16 PM. Reason: problem solved

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    You should start checking your spelling of the group and user names you've entered. You probably used the user creation tools to add a user and a group, but you should double check them. There should be entries in /etc/group /etc/passwd and /etc/shadow for the users you've created - check that their entries match the other entries in those files.

    Go to a text console and try to log-on as that user (you might have to set a password for them first) - if you can log on correctly then you know the user works. You can delete their hashed password field from /etc/shadow after this if all is well.

    If you can log on as that user, try changing the user and group of a file separately, and without the recursion like this:

    $ echo " " > testfile.txt
    $ sudo chown asteriskpbx testfile.txt
    $ ls -l
    and if that works try
    $ sudo chgrp asteriskpbx test.txt
    $ ls -l
    If either of these fail you'll have an idea where the problem lies - and if they both work then you've probably got an error somewhere else. Give this a try and report back to this thread if it still doesn't work.
    Linux user #126863 - see

  3. #3
    i didn' t used a user creation tool... i created the user named asteriskpbx from cli... and added the group named pbx through adding the necessary lines to the files below

    spelling is ok....

    from /etc/group file related line -> pbx:x:1002:asteriskpbx

    from /etc/sudoers file related line -> %pbx ALL=(ALL) ALL

    from /etc/gshadow file related line -> pbx:!::asteriskpbx

    i tried the first test for the asteriskpbx user... no problem...
    i tried the second test for the pbx group(which asteriskpbx belongs)... no problem....

    but still no luck with the recursive folder/file permission changes....

  4. $spacer_open
  5. #4
    i' m an idiot... command itself is wrong.... it should have been:

    $ sudo chown -R asteriskpbx:pbx /usr/lib/asterisk/

    not pbx:asteriskpbx

    although it might have something to do with using

    $ sudo groupadd -f pbx

    before trying the right syntax. because when the group name and the user name was the same(both asteriskpbx) it wasn' t working...

    thank you for your answer anyway...
    Last edited by ysuluhan; 08-18-2011 at 02:19 PM. Reason: additional info...

  6. #5
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    There's definitely no inherent problem with matching user and group names. root:root, oracle:oracle, etc.

  7. #6
    then it has definitely something to do with "groupadd -f"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts