group user
id -Gn user
sk8harddiefast said:Also to see on witch group you are:
(Where user is the name you set)Code:group user
or
(Where user is the name you set)Code:id -Gn user
To add user to a group:
just modify /etc/group
Miax said:I have made a user account, but I don't know which default group gives which permissions except wheel. Is there a document about this?
$ ls -l
$ ls -l su*
-r-sr-xr-x 1 root wheel 14500 Jul 18 22:24 su*
-r-xr-xr-x 2 root wheel 8860 Jul 18 22:24 sum*
$
$ cat /etc/group
Errmm. No, it also shows that the 'other' group has read and execute access. The 'other' group means everyone. Hence, everyone can read or execute those files.noz said:Code:$ ls -l su* -r-sr-xr-x 1 root wheel 14500 Jul 18 22:24 su* -r-xr-xr-x 2 root wheel 8860 Jul 18 22:24 sum* $
From the above code, it shows that you can run su or sum if you are root or in the wheel group.
chown -R [B]user file[/B]
chown -R emberdaemon skate/
usergroups() { for user in $(awk -F: '/^[[:space:]]*#/ {NR--; next} {print $1}' /etc/passwd); do echo "$user: $(groups $user)"; done; }
groupusers() { cat /etc/group | awk -F: '/^[[:space:]]*#/ {NR--; next} {print $1, $3, $4}' | while read group gid members; do
members=$members,$(awk -F: "/^[[:space:]]*#/ {NR--; next} \$4 == $gid {print \",\" \$1}" /etc/passwd);
echo "$group: $members" | sed 's/,,*/ /g';
done; }
➜ ~ # usergroups
root: wheel operator
toor: wheel
daemon: daemon
operator: operator
bin: bin
tty: nogroup
kmem: nogroup
games: games
news: news
man: man
sshd: sshd
smmsp: smmsp
mailnull: mailnull
bind: bind
unbound: unbound
proxy: proxy
_pflogd: _pflogd
_dhcp: _dhcp
uucp: uucp
pop: mail
auditdistd: audit
www: www
_ypldap: _ypldap
hast: hast
nobody: nobody
git_daemon: git_daemon
➜ ~ # groupusers
wheel: root root toor
daemon: daemon
kmem:
sys:
tty:
operator: root operator
mail: pop
bin: bin
news: news
man: man
games: games
ftp:
staff:
sshd: sshd
smmsp: smmsp
mailnull: mailnull
guest:
video:
bind: bind
unbound: unbound
proxy: proxy
authpf:
_pflogd: _pflogd
_dhcp: _dhcp
uucp: uucp
dialer:
network:
audit: auditdistd
www: www
_ypldap: _ypldap
hast: hast
nogroup: tty kmem
nobody: nobody
git_daemon: git_daemon