Sponsored Content
Full Discussion: Creating groups and users
Top Forums UNIX for Advanced & Expert Users Creating groups and users Post 302697645 by Dorothy on Friday 7th of September 2012 07:02:26 AM
Old 09-07-2012
But my idea too is that 'id' should be a better approach. getent again is a pattern matching thing and could be ambiguous if there are users like test, test1, test2 and we are looking only for test user. Please correct me if i am wrong. I know that giving the correct pattern could be a solution, but the example I have taken is only a simple one. Is 'id' not the surest way to do this as compared to getent, grep etc.?
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Users and groups

Hi, Is it possible that one user belongs to many groups, or the relation of user/group is 1/1?. Thanks Ramón (2 Replies)
Discussion started by: rsanz
2 Replies

2. Linux

listing users and groups

RH 7.2 I'm trying to list the users & groups on my machine. I found the lsuser & lsgroup commands but no associated man pages. I typed: lsuser I get --> Valid options are: -a So I typed: lsuser -a I get --> Valid options are: groups, home So I typed: lsuser -a groups I get -->... (2 Replies)
Discussion started by: jalburger
2 Replies

3. UNIX for Dummies Questions & Answers

users and groups

hi eveyone i've recently requested my unix admin to create a userid for 2 groups. He created the id and i can see it by grep "id" /etc/group. But when i login with that id into unix and try to cd that group it says permission denied. something like cd /groupname -- permission denied Can my admin... (1 Reply)
Discussion started by: sammet
1 Replies

4. UNIX for Dummies Questions & Answers

Finding out all users and their UNIX groups??

Is there a way to find out all users and the UNIX groups they belong to?? :) (3 Replies)
Discussion started by: Hangman2
3 Replies

5. Solaris

Defaults number of users and Groups

Hi All, I would like know how many of default number of users and groups are there in solaris-10... Regards Tirupathi Raju (2 Replies)
Discussion started by: tirupathiraju_t
2 Replies

6. Solaris

Removing users from groups

How do I remove a user from a group? I'm using the usermod command but its not working. I have a user "abc" who is a member of the groups root and other. I'm trying to remove him from the group "other" (using CLI) which is his secondary group but it's not working. How do I do this? Is there any... (11 Replies)
Discussion started by: the_red_dove
11 Replies

7. UNIX for Dummies Questions & Answers

List users and groups

Hi I am new to unix so hopefully someone can help. I need to list all the users I have in my unix enviroment (AIX) and the groups (primary and secondary) they belong to. Can anyone help? Many thanks in advance (2 Replies)
Discussion started by: m3y
2 Replies

8. Shell Programming and Scripting

users and groups /etc/group parsing

Hi, I have two little issues: 1) there is possible in sh to create a function who return a boolean value? 2)i have to verify if an user belongs to a group and i think it is needed to create a function which take two parameter and return a boolean value. in fact i have to parse /etc/group... (5 Replies)
Discussion started by: catalint
5 Replies

9. UNIX for Dummies Questions & Answers

Users in multiple groups?

Happy Thanksgiving Everyone!! I have a question about adding users to multiple groups. Thanks in advance Using Red Hat and here are the issues: Example: Users: Bob Mark Groups: SystemsAnalysts BusinessAnalysts If I am adding a user Bob to both groups (SystemsAnalysts and... (2 Replies)
Discussion started by: hansokl
2 Replies

10. HP-UX

Creating user groups that are persistent

Hi, I need to modify the user 'munfai' by adding it into groups bscs, oinstall, dba. I use this command as user root to add the user into the mentioned groups : # usermod -G bscs,oinstall,dba munfai I can thereafter see the id in the groups : # id munfai uid=258(munfai) gid=20(users)... (2 Replies)
Discussion started by: anaigini45
2 Replies
userdel(1M)															       userdel(1M)

NAME
userdel - delete a user login from the system SYNOPSIS
alternate_password_file] login DESCRIPTION
The command deletes a user login from the system by modifying the appropriate login related files. The command requires the login argument. login is the name to be deleted, specified as a string of printable characters. It may not con- tain a colon or a newline Refer to usergroupname(5) to understand the functionality changes with the Numeric User Group Name feature. Options recognizes the following options: The home directory of login is removed from the system. This directory must exist. Following the successful execution of this command, none of the files and directories under the home directory will be available. If a user is deleted and the home directory is shared by others, then this directory is not deleted even with the option. Force the changes, even if the login is currently in use. Specify that the changes are being made to the alternate password file of NIS specified by the option. The and options should not be used with this option. Specify the path of the alternate password file of NIS. The option is used with the option. In the event where a directory is shared by users of the same group and the owner of that directory is deleted, then the ownership of that directory is propagated to the next user who is sharing that directory. The new owner is determined by looking at the order in which the users sharing this directory are added to the file. If there is only one user remaining then the directory is brought back to unshared mode by resetting the permissions to from NIS This command is aware of NIS user and group entries. Only local users and groups may be deleted or modified with this command. Attempts to delete or modify NIS users or groups will result in an error. NIS users and groups must be administered from the NIS server. The com- mand may fail with the error (return value 6) if the user specified is an NIS user (see passwd(4)). The error (return value 10) is returned if a local user belongs to an NIS group (see group(4)). NFS Errors may occur with the option if the affected directory is within an NFS mounted file system that does not allow root privileges across the NFS mount, and the directory or files within the directory do not have sufficient permissions. RETURN VALUE
exits with one of the following values: Successful completion. Invalid command syntax. Invalid argument supplied to an option. The login to be removed does not exist. The login to be removed is in use. Cannot modify the file, but the login was removed from the file. Unable to remove or modify the home directory. Unable to open file or file is non-existent. file or file busy. Another command may be modifying the file. Cannot delete entry from file. Out of memory. Invalid template file. EXAMPLES
Remove the user from the system: Remove the user from the system and delete home directory from the system: WARNINGS
Because many users may try to write the file simultaneously, a password locking mechanism was devised. If this locking fails after subse- quent retrying, terminates. FILES
Shadow Password file System Password file System group file Lock file used when updating password file SEE ALSO
passwd(1), users(1), groupadd(1M), groupdel(1M), groupmod(1M), logins(1M), useradd(1M), usermod(1M), group(4), passwd(4), shadow(4), user- groupname(5). STANDARDS CONFORMANCE
userdel(1M)
All times are GMT -4. The time now is 03:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy