Dear Folks :-)
I want to rsync some files between some servers and preserve files owner and group (not UID or GID), in some machines UID and GID are differents, for example:
a) In the rsync server:
# stat vbseo.php
File: `vbseo.php'
Size: 26758 Blocks: 56 IO... (1 Reply)
Hi there,
One can easily retrieve the uid from a username :
id -u $username
But how can we easily retrieve the gid from a group name?
I mean is there a command without using sed?
sed -nr "s/^$groupname:x:(+):.*/\1/p" /etc/group
Thanks for your help
Santiago (7 Replies)
Checking configuration access files for an AIX server, left me wondering about this :confused::
If a user is added to system group, it gets gid=0 with some security risks because it gets some root kind of file access level.
Is this insecure condition kept if the user has admin variable... (0 Replies)
I have thousands of users assigned various roles. The role header defines the GID that they should have. If I can get all the GID information into /etc/group format I can upload the output file and easily assign all users into the desired GID. Right now I can get an output file like this:... (5 Replies)
Hi,
I have problem with a script, it was working for 6 month and suddenly I started getting strange expire times
example:
# chage -l wXXp
Last password change : Oct 28, 2014
Password expires : Nov 27, 2014
Password... (3 Replies)
Hi guys,
I have a question. In the passwd file, user johndoe has a GID of 100 which is the group named users in the group file. But if you check the group file, johndoe is not listed under GID 100, but under GID 33, which is the group named videos. Under what group does johndoe really belong,... (1 Reply)
Hi Everyone,
We are encountering the following issue on AIX 5.3. When we do ls -ltr the list displays only user id and group id instead of user name and group name.
This is happening for all users except root. Whe we do ls -ltr with root user it shows perfectly fine.
When we searched... (25 Replies)
I would like to get an opinion for my solution for this task and get feedback about better approach or mistakes I have made.
1. The problem statement, all variables and given/known data:
The task is to create a script which prints information about users whose names are specified in the... (2 Replies)
Hi,
I have a file with usernames, and the comment section, e.g :
Data removed by request of sanchitadutta91, 20 May 2020
I need to add these users into a server. Is it possible to use a script to create the users, together with the comment ?
From the commandline to add one user, the... (2 Replies)
Discussion started by: anaigini45
2 Replies
LEARN ABOUT PHP
posix_getgrgid
POSIX_GETGRGID(3) 1 POSIX_GETGRGID(3)posix_getgrgid - Return info about a group by group idSYNOPSIS
array posix_getgrgid (int $gid)
DESCRIPTION
Gets information about a group provided its id.
PARAMETERS
o $gid
- The group id.
RETURN VALUES
The array elements returned are:
The group information array
+--------+---------------------------------------------------+
|Element | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| name | |
| | |
| | The name element contains the name of the group. |
| | This is a short, usually less than 16 character |
| | "handle" of the group, not the real, full name. |
| | |
|passwd | |
| | |
| | The passwd element contains the group's password |
| | in an encrypted format. Often, for example on a |
| | system employing "shadow" passwords, an asterisk |
| | is returned instead. |
| | |
| gid | |
| | |
| | Group ID, should be the same as the $gid parame- |
| | ter used when calling the function, and hence |
| | redundant. |
| | |
|members | |
| | |
| | This consists of an array of string's for all |
| | the members in the group. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Example use of posix_getgrgid(3)
<?php
$groupid = posix_getegid();
$groupinfo = posix_getgrgid($groupid);
print_r($groupinfo);
?>
The above example will output something similar to:
Array
(
[name] => toons
[passwd] => x
[members] => Array
(
[0] => tom
[1] => jerry
)
[gid] => 42
)
SEE ALSO posix_getegid(3), posix_getgrnam(3), filegroup(3), stat(3), safe_mode_gid, POSIX man page GETGRNAM(3).
PHP Documentation Group POSIX_GETGRGID(3)