chown when owner has a dot in name


Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: chown when owner has a dot in name

  1. #1
    Join Date
    Jun 2002
    Posts
    6

    chown when owner has a dot in name

    how can you change ownership of a file if the username you want to use has dot (.) in it? ... such as info.abc

    When I try this, chown gives an error, "no such group", because the dot signifies a group name. I've tried single (') and double quotes (") around the name info.abc, which don't work either.

  2. #2
    Join Date
    Aug 2001
    Posts
    1,436
    Well not to be an *** but who creates user names with a . in it anyway?
    Mama always said life was like a box of chocolates.

  3. #3
    Join Date
    Jun 2002
    Posts
    6
    since the server can only have unique names, you can't have two info@ users on one box... so by making it unique such as info.abc and info.def, etc. the user can be aliased as 'info'.

    when the user is created its no problem, but something happened during a migration that requires the owner be set back to user name.

  4. #4
    Join Date
    Aug 2001
    Posts
    1,436
    Originally posted by matt syracuse:
    <STRONG>since the server can only have unique names, you can't have two info@ users on one box... so by making it unique such as info.abc and info.def, etc. the user can be aliased as 'info'.

    when the user is created its no problem, but something happened during a migration that requires the owner be set back to user name.</STRONG>

    Ah I see, but wouldnt an easier way have been to create a normal name and then alias it? Kinda the other way around?

    [ 24 June 2002: Message edited by: chikn ]
    Mama always said life was like a box of chocolates.

  5. #5
    Join Date
    Jun 2002
    Posts
    6
    when you have 250 sites on a box (isn't Linux great) it makes it easier to find all the matching users by info.* ... any clues on how to chown with this type of name?

    If I delete and re-create the user it's ok, but I have too many of them to do this with.

    [ 24 June 2002: Message edited by: matt syracuse ]

  6. #6
    Join Date
    Aug 2001
    Posts
    1,436
    I just created a user with a . in it test.123 created a files then chown the file to that user and it worked with the .


    May 24 13:29 sbin/
    drwxrwxrwx 2 root root 4096 Jun 5 16:31 share/
    -rw-r--r-- 1 test.1 root 11 Jun 24 11:53 test1
    drwxrwxrwt 7 root root 4096 Jun 24 04:21 tmp/
    drwxr-xr-x 15 root root 4096 May 29 14:56 usr/
    [ 24 June 2002: Message edited by: chikn ]
    Mama always said life was like a box of chocolates.

  7. #7
    Join Date
    Jun 2002
    Posts
    6
    the command "chown user.123 user.123" doesn't work - it says 'invalid group' -- what was your syntax?

  8. #8
    Join Date
    Aug 2001
    Posts
    1,436
    chown &lt;user&gt; &lt;filename&gt;

    If they need to belong to a certain group then

    chgrp &lt;group&gt; &lt;filename&gt;
    Mama always said life was like a box of chocolates.

  9. #9
    Join Date
    Aug 2001
    Posts
    1,436
    Now that I think about it, it could be the folder name having the period causing the problem.
    Try to chown the path

    chown user.abc /home/user.abc

    [ 24 June 2002: Message edited by: chikn ]
    Mama always said life was like a box of chocolates.

  10. #10
    Join Date
    Jun 2002
    Posts
    6
    nope that didn't work - it's the first argument that's causing the problem

    ---------\/
    chown user.123 user.123

    [ 24 June 2002: Message edited by: matt syracuse ]

  11. #11
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    1,450
    When you create a user and group, it is given a numeric value as well (look in /etc/passwd and /etc/group.

    use chown [uuid]:[gid] (filename)

    *grin*
    Lorithar ~~

    The sum total of intelligence on the planet is a constant. Warning. The population is growing at an alarming rate.

  12. #12
    Join Date
    Jun 2002
    Posts
    6
    funny you mention that because some of the files have numeric values as the owner! ... still, is there a way to assign the owner with a name containing a dot (.) like info.abc?

    create a user like info.abc
    notice a file is owned by info.abc
    chown root &lt;file&gt;
    now try: chown info.abc &lt;file&gt;

    does it work for anyone?

  13. #13
    Join Date
    Aug 2001
    Posts
    1,436
    Originally posted by matt syracuse:
    <STRONG>funny you mention that because some of the files have numeric values as the owner! ... still, is there a way to assign the owner with a name containing a dot (.) like info.abc?

    create a user like info.abc
    notice a file is owned by info.abc
    chown root &lt;file&gt;
    now try: chown info.abc &lt;file&gt;

    does it work for anyone?</STRONG>

    Like I mentioned before it works on my boxen, dont understand why yours would act differently.
    Mama always said life was like a box of chocolates.

  14. #14
    Join Date
    May 2014
    Posts
    1
    I know this is an old thread, but the search term I used didn't give me any other forums.

    I solved this problem by using id command. If your username is frank.name run the command: id frank.name

    The output will have the id of frank in it in the form of uid=203(frank.name), where 203 is the system assigned user id.

    then in your chown command instead of typing the username, use the uid and it will work. So it would look something like this:

    chown 203:users <filename>

  15. #15
    Join Date
    Jun 2017
    Posts
    2
    chown info\.abc filename

    The Backslash escapes dot

Posting Permissions

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