• April 22, 2024, 11:51:58 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Users and groups - what is user 501 and user 502?  (Read 35864 times)

random404

  • Level 1 Member
  • *
  • Posts: 23
Users and groups - what is user 501 and user 502?
« 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.
Logged

jhtopping

  • Level 2 Member
  • **
  • Posts: 73
Re: Users and groups - what is user 501 and user 502?
« Reply #1 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.
Logged

dosborne

  • Level 5 Member
  • *****
  • Posts: 598
Re: Users and groups - what is user 501 and user 502?
« Reply #2 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.
« Last Edit: October 14, 2011, 05:51:24 PM by dosborne »
Logged
3 x DNS-323 with 2 x 2TB WD Drives each for a total of 12 TB Storage and Backup. Running DLink Firmware v1.08 and Fonz Fun Plug (FFP) v0.5 for improved software support.