• February 24, 2025, 04:57: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: Understanding users and groups  (Read 2859 times)

random404

  • Level 1 Member
  • *
  • Posts: 23
Understanding users and groups
« on: October 26, 2011, 06:07:38 AM »

Here is the /etc/passwd and /etc/group on my DNS-323. I created only 1 user called 'nas', and created no groups. When I mount /mnt/HD_a2 using CIFS from my LINUX laptop, I do so using this user 'nas'.

Code: [Select]
$ cat /etc/passwd
root:x:0:0:Linux User,,,:/mnt/HD_a2/ffp/home/root:/ffp/bin/bash
admin:x:500:500:Linux User,,,:/home/admin:/bin/sh
nobody:x:501:501:Linux User,,,:/home/nobody:/bin/sh
sshd:x:33:33:sshd:/:/bin/false
nas:x:502:502:Linux User,,,:/home/ftp:/bin/sh

Code: [Select]
$ cat /etc/group
root:x:0:root
500:x:500:admin
501:x:501:nobody
utmp:x:22:
sshd::33:sshd

So here are some questions. In /etc/passwd you see nas with :502:502:, so it has a group identifier of 502. Why is it using a group of 502 - I didn't create any group in the web interface, so why is there a group of 502 here?

And why does that group 502 not appear in /etc/group?

Let's say I telnet/ssh into the DNS-323 and do a 'touch /mnt/HD_a2/created-from-telnet', and then from my Linux laptop which has mounted Volume_1 with CIFS as the user 'nas' I do a 'touch '/mnt/mount-point-of-Volume_1/created-from-cifs', the following is what I see:

As seen from telnet/ssh on DNS-323
Code: [Select]
-rwxrwxrwx 1 nas 502 0 Oct 26 13:37 created-from-cifs
-rw-r--r-- 1 root root 0 Oct 26 13:47 created-from-telnet

As seen from Linux laptop which has mounted Volume_1
Code: [Select]
-rwxrwxrwx. 1  502  502 0 Oct 26 13:37 created-from-cifs
-rw-r--r--. 1 root root 0 Oct 26 13:47 created-from-telnet

A few questions about this output. For created-from-cifs, in the second case it shows 502:502 instead of nas:502 in the first case. Why this difference?

In both cases, created-from-telnet shows as root:root. The 'root' in the first case is root on the DNS-323 and 'root' in the second case is root on my Linux laptop. Technically aren't these 2 different users? So isn't this misleading that they appear to be the same here, it makes it look like they're the same user... I'm a bit confused here.
Logged