Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

newgrp(1) [linux man page]

NEWGRP(1)							   User Commands							 NEWGRP(1)

NAME
newgrp - log in to a new group SYNOPSIS
newgrp [-] [group] DESCRIPTION
The newgrp command is used to change the current group ID during a login session. If the optional - flag is given, the user's environment will be reinitialized as though the user had logged in, otherwise the current environment, including current working directory, remains unchanged. newgrp changes the current real group ID to the named group, or to the default group listed in /etc/passwd if no group name is given. newgrp also tries to add the group to the user groupset. If not root, the user will be prompted for a password if she does not have a password (in /etc/shadow if this user has an entry in the shadowed password file, or in /etc/passwd otherwise) and the group does, or if the user is not listed as a member and the group has a password. The user will be denied access if the group password is empty and the user is not listed as a member. If there is an entry for this group in /etc/gshadow, then the list of members and the password of this group will be taken from this file, otherwise, the entry in /etc/group is considered. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: SYSLOG_SG_ENAB (boolean) Enable "syslog" logging of sg activity. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO
id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(5). User Commands 06/24/2011 NEWGRP(1)

Check Out this Related Man Page

NEWGRP(1)                                                          User Commands                                                         NEWGRP(1)

NAME
newgrp - log in to a new group SYNOPSIS
newgrp [-] [group] DESCRIPTION
The newgrp command is used to change the current group ID during a login session. If the optional - flag is given, the user's environment will be reinitialized as though the user had logged in, otherwise the current environment, including current working directory, remains unchanged. newgrp changes the current real group ID to the named group, or to the default group listed in /etc/passwd if no group name is given. newgrp also tries to add the group to the user groupset. If not root, the user will be prompted for a password if she does not have a password (in /etc/shadow if this user has an entry in the shadowed password file, or in /etc/passwd otherwise) and the group does, or if the user is not listed as a member and the group has a password. The user will be denied access if the group password is empty and the user is not listed as a member. If there is an entry for this group in /etc/gshadow, then the list of members and the password of this group will be taken from this file, otherwise, the entry in /etc/group is considered. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: SYSLOG_SG_ENAB (boolean) Enable "syslog" logging of sg activity. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO
id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(5). shadow-utils 4.5 01/25/2018 NEWGRP(1)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

root group permissions

Hello, Another newbie here and here is my dilemma. I created an account for me on Solaris 8 and I added myself to the root group. But when I login using that account I am unable to do superuser tasks.. (add users, admintool, etc). What am I missing? Thanks in advance.. Andre (5 Replies)
Discussion started by: jacobsa
5 Replies

2. UNIX for Advanced & Expert Users

login error(can not set process env.)

I have created user in AIX 4.3.3 which the member of staff group. but during login ( with su command) it gives the error "can not set process environment " but when it is member of another group -dba -which is the group for oracle database- it works properly. Pls let me know the solution. ... (5 Replies)
Discussion started by: amit
5 Replies

3. Solaris

how can I change user name and password , of account ?

passwd only changes the password but i need to change the user name tnx (5 Replies)
Discussion started by: umen
5 Replies

4. Shell Programming and Scripting

How to update passwd

I created a new user for my SUN machine for eg iachasta 1.) added the entry in the /etc/passwd file with corresponding group Id. 2.) The resp group Id was added in /etc/group file. 3.) I made entry in /etc/shadow file also . i am able to login with user iachasta as su - iachasta ... (5 Replies)
Discussion started by: er_aparna
5 Replies

5. UNIX for Dummies Questions & Answers

Change other account password from root access

Hi, I have forgotten my personal account password but I still have the root access to the box. Please tell me how can I change my other account password by logging as root. Thanks. Rakesh :D (4 Replies)
Discussion started by: rakeshou
4 Replies

6. AIX

How to use SSH Secure File Transfer tool from windows to AIX without password?

If I use SSh Secure File Transfer tool on Windows, I want to transfer file from windows to AIX without password, how to do it? (6 Replies)
Discussion started by: rainbow_bean
6 Replies

7. UNIX for Dummies Questions & Answers

Default Group

How do I set the default group a new user account belongs to? Thanks (3 Replies)
Discussion started by: mojoman
3 Replies

8. Solaris

PAM, Solaris, Openssh and Forcing a password change

Here's the issue. Currently when I run passwd -f "username" on any account, when I try to login with said account I don't get prompted to change my password I just keep getting prompted to input a password. (Of course this works just fine with telnet)Is there something i need to add to... (7 Replies)
Discussion started by: woodson2
7 Replies

9. Solaris

How to list group members in solaris 9

Hi, I already gone through with old post regarding listing the group members and tried the command getenv group other the result is other::1:root i listed my part of the /etc/passwd file below test1:x:100:1::/home/test1:/bin/sh test2:x:101:1::/home/test2:/bin/ksh... (7 Replies)
Discussion started by: vr_mari
7 Replies

10. UNIX for Dummies Questions & Answers

Group permissions

Hi, I've created a user named fwadmin, group named fwadmin and made the user belong to that group. I created the user and group using the 'User Manager' in Centos. The user belongs to /etc/fw.Does this also mean that the group fwadmin belongs to /etc/fw. That is what I want. But when I... (4 Replies)
Discussion started by: anaigini45
4 Replies

11. Solaris

Unable to change password for a user.

I am getting the following error message "passwd: User unknown: username" Permission denied error message when trying to change the password for that given user account. The user account is within the /etc/passwd file and I can also su to the account without any problems. This is sever is not... (11 Replies)
Discussion started by: eckmanb
11 Replies

12. UNIX for Advanced & Expert Users

How to change default group?

Hi frnds, I would like to change my default group. I tried using newgrp, but it will change the group in that xterm only. If i open a new xterm that setting is gone. Also i tried by putting newgrp <my_grp> into the file .cshrc which will be run during startup. Eventhough its working, it is... (5 Replies)
Discussion started by: appualex
5 Replies

13. Red Hat

Save sudo privilege for session

I have setup public key based login to my CentOS VPS. I wish to disable direct root login and have created an admin user under wheel group and have modified /etc/sudoers file and gave Wheel group all privileges. But now I am being prompted for password whenever I type sudo. I do not wish to... (4 Replies)
Discussion started by: JoyceBabu
4 Replies

14. Solaris

User id modification

Dear All, Some of the users having the same user id and group id in my /etc/passwd file. Now I want to change the users to have a unique user id and group id. How can we do that. If I change this will it affect the running applications. Rgds Rj (7 Replies)
Discussion started by: jegaraman
7 Replies

15. UNIX for Dummies Questions & Answers

User size used

I would like to check the used size of all user login ID , I tried the command du -a , du -h , it seems can only find the current directory , If I would like to list all user ( the user list in /etc/passwd ) its used space , from largest to smallest , would advise what can I do ? thanks The... (5 Replies)
Discussion started by: ust3
5 Replies