Operating System - HP-UX
1821583 Members
3725 Online
109633 Solutions
New Discussion юеВ

Using usermod while the user is logged

 
SOLVED
Go to solution
Enrico Venturi
Super Advisor

Using usermod while the user is logged

Hi colleagues,
I want to change the primary and / or the supplementary groups of some users and I don't want to make them to logoff ....
what can I do?
If I try I get the result "The login snml is currently in use" ......

thanks
Enrico
6 REPLIES 6
Asif Sharif
Honored Contributor

Re: Using usermod while the user is logged

I think you need to logoff the user before changing the group.

Regards,
Asif Sharif
Regards,
Asif Sharif

Re: Using usermod while the user is logged

You will have to *carefully* edit the passwd file yourself (assuming thats where you keep your user data).

After you've made the change, the users env won't change until they either logout and back in or issue a newgrp command.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Srimalik
Valued Contributor

Re: Using usermod while the user is logged

The password file will contain entries like fro all the users

root:x:0:1:Super-User:/:/sbin/sh

:
abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: Using usermod while the user is logged

the password file is /etc/passwd
abandon all hope, ye who enter here..
Doug Burton
Respected Contributor
Solution

Re: Using usermod while the user is logged

You can try this while the user is logged in:

/usr/sam/lbin/usermod.sam -F -G $NEWGRP $EMPLID
Doug Burton
Respected Contributor

Re: Using usermod while the user is logged

Sorry, forgot to mention (it may be obvious?) to change the NEWGRP to the group you want to change the user to and the EMPLID should be the users ID.