D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-323 => Topic started by: random404 on October 11, 2011, 02:07:14 AM

Title: Users and groups - what is user 501 and user 502?
Post by: random404 on October 11, 2011, 02:07:14 AM
Some of the files on my DNS 323 are owned by user/group 501, and some are owned by user/group 502. All new files I add are now created by user 502, so I don't know where 501 is coming from. When I look in the web console of my device and go to Advanced > Users/Groups, I only see one user. I also see no groups. So where is user 501 coming from?

I'd like to change all files/directories to be owned by user/group 501 for consistency sake, but when I run the following command I get "chown: changing ownership of `/path/to/file/on/dns': Invalid argument"

sudo chown 501:501 /path/to/file/on/dns

Does this have to do with user 501 not existing on the DNS 323? If so, how can I 'recreate' it? Thanks.
Title: Re: Users and groups - what is user 501 and user 502?
Post by: jhtopping on October 14, 2011, 03:29:50 PM
I am not sure my terminology is totally correct, but I feel some answer is more helpful to you than no answer.

User 501 is the admin user when you connected using the web interface.  I do not see user 502 on my system.  From what I see when I ftp into the system, it appears 500 series files were created during the "Run Wizard" process.  It would be my guess that you started the "Easy Setup Utility" and ran the Wizard.  After the system restarted, did you login again as user "admin" and perform the ADVANCED setup options of creating users and groups?  

It is hard to tell you how to correct things without knowing more.  As I remember, when I first started, I rebuild my system several times before I knew what I was doing.  

Hope this helps.
Title: Re: Users and groups - what is user 501 and user 502?
Post by: dosborne on October 14, 2011, 05:34:45 PM
I would have to disagree, at least partically. Looking at /etc/passwd is see:
Code: [Select]
/ #  cat /etc/passwd
root:x:0:0:Linux User,,,:/usr/share/ftp_server:/bin/sh
admin:x:500:500:Linux User,,,:/usr/share/ftp_server:/bin/sh
nobody:x:501:501:Linux User,,,:/usr/share/ftp_server:/bin/sh
ftp:*:95:95::/usr/share/ftp_server:/bin/sh
user1:x:502:502:Linux User,,,:/usr/share/ftp_server:/bin/sh
user2:x:503:503:Linux User,,,:/home/ftp:/bin/sh
user3:x:504:504:Linux User,,,:/home/ftp:/bin/sh
It may, and most likely, have to do with the order in which users are created. In my case, the admin user is 500, user "nobody" is 501. The users I created myself were numbered 502 and up. Since your system is different, although my 3 units are identical, I can only assume it relates to the order in which things were configured.

Therefore it is impossible for anyone to accurately tell the OP what specific users "501" and "502" are without looking at the above mentioned file.

Similarly for group IDs
Code: [Select]
/ # cat etc/group
root:x:0:root
500:x:500:admin
501:x:501:nobody
utmp:x:22:

To answer

sudo chown 501:501 /path/to/file/on/dns

Does this have to do with user 501 not existing on the DNS 323? If so, how can I 'recreate' it? Thanks.
The correct syntax is:
 chown [OPTION]... [OWNER][:[GROUP]] FILE...

"owner" is the equivalent to "user"

User "nobody" is a special case in Linux. Be careful changing ownership as you don't want to mess things up, particularly in the root, but essentially to open up ownership, you would connect as an administrator and issue the command:
chown -R nobody:501 /path

You may also need to research the "chmod" command as by changing the mode you can also remove restrictions on files and directories.