Sponsored Content
Top Forums UNIX for Advanced & Expert Users Update users password change time Post 302553379 by NH2 on Wednesday 7th of September 2011 11:21:10 AM
Old 09-07-2011
man usermod

HTH,
/Lew
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To simultaneously update password change in two server at a time

I am new beginner in Unix and little experienced in BaaN ERP. Problem Statement: I have to run a BaaN session. I have to change the password for both primary and secondary server by using this session. On primary server only few people has access permission (say 10). But on secondary server... (0 Replies)
Discussion started by: s_chandrakar
0 Replies

2. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

3. Shell Programming and Scripting

Help- Change the password of users to common one

Hi all I have some 106 users of which i need to change the password of them to a common one. I dont know their paswword. But i need to reset them to a common one. How can i do this with a shell script? It would be a great help if some one can help to sort out this.:b::b: I know it can be... (0 Replies)
Discussion started by: Tuxidow
0 Replies

4. Solaris

How to enforce all users to change their password

Hi All, How to enforce all users to change their password when they try to login. I am having Solaris 9 and 10. Even it would be much better if anyone can say to enforce all users to change their password next morning they login. Thanks in advance, Deepak (3 Replies)
Discussion started by: naw_deepak
3 Replies

5. Shell Programming and Scripting

script to change password for all users

We have a server where we have a number of user ids and we also have the list of old passwords in a CSV file. Now we want to change the password of all the users and assign them a default password.Can we write a shell script to do that. I am planning to read the user name and corresponding... (7 Replies)
Discussion started by: dr46014
7 Replies

6. Solaris

To restrict the users not to change the passwords for NIS users

Hi All, How to restrict the NIS users not to change their passwords in for NIS users?? and my NIS user is unable to login to at client location what could be the problem for this ? Any body can help me. Thanks in advance. (1 Reply)
Discussion started by: Sharath Kumar
1 Replies

7. Solaris

Change password for users

I am on SunOS SolarisServer 5.11 11.1 i86pc i386 i86pc , I am trying to change password for a user,but I get the following message.I cannot find any google help on the matter.can anyone help? root@SolarisServer:~# passwd passwd: Changing password for stain Please try again Please try... (6 Replies)
Discussion started by: cbtshare
6 Replies

8. Shell Programming and Scripting

Bulk NIS Users Password Change

Hi All, I am having Solaris 5.10 acting as NIS. How do i change multiple user password in NIS in a batch. I have predefined users with their passwords to be set: Example: user1 password1 user2 password2 Pls advise. (0 Replies)
Discussion started by: yogajwa
0 Replies

9. AIX

Change password for many users on an AIX server

Hi I want to change password for around 100 users on an aix server. I have the list of those 100 users with me. instead of doing # passwd username for all the 100 users one by one, can you please help with a script through which we can change the password for all the 100 users in a... (2 Replies)
Discussion started by: newtoaixos
2 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies
usermod(1M)						  System Administration Commands					       usermod(1M)

NAME
usermod - modify a user's login information on the system SYNOPSIS
usermod [-u uid [-o]] [-g group] [-G group [, group...]] [-d dir [-m]] [-s shell] [-c comment] [-l new_name] [-f inactive] [-e expire] [-A authorization [, authorization]] [-P profile [, profile]] [-R role [, role]] [-K key=value] login DESCRIPTION
The usermod utility modifies a user's login definition on the system. It changes the definition of the specified login and makes the appro- priate login-related system file and file system changes. The system file entries created with this command have a limit of 512 characters per line. Specifying long arguments to several options might exceed this limit. OPTIONS
The following options are supported: -A authorization One or more comma separated authorizations as defined in auth_attr(4). Only a user or role who has grant rights to the authorization can assign it to an account. This replaces any existing authorization setting. If no authorization list is specified, the existing set- ting is removed. -c comment Specify a comment string. comment can be any text string. It is generally a short description of the login, and is currently used as the field for the user's full name. This information is stored in the user's /etc/passwd entry. -d dir Specify the new home directory of the user. It defaults to base_dir/login, where base_dir is the base directory for new login home directories, and login is the new login. -e expire Specify the expiration date for a login. After this date, no user will be able to access this login. The expire option argument is a date entered using one of the date formats included in the template file /etc/datemsk. See getdate(3C). For example, you may enter 10/6/90 or October 6, 1990. A value of `` '' defeats the status of the expired date. -f inactive Specify the maximum number of days allowed between uses of a login ID before that login ID is declared invalid. Normal values are posi- tive integers. A value of 0 defeats the status. -g group Specify an existing group's integer ID or character-string name. It redefines the user's primary group membership. -G group Specify an existing group's integer "ID" "," or character string name. It redefines the user's supplementary group membership. Dupli- cates between group with the -g and -G options are ignored. No more than NGROUPS_UMAX groups may be specified as defined in <param.h>. -K key=value Replace existing or add to a user's key=value pair attributes. Multiple -K options can be used to replace or add multiple key=value pairs. However, keys must not be repeated. The generic -K option with the appropriate key can be used instead of the specific implied key options (-A, -P, -R, -p). See user_attr(4) for a list of valid keys. Values for these keys are usually found in man pages or other sources related to those keys. For example, see project(4) for guidance on values for the project key. Use the command ppriv(1) with the -v and -l options for a list of values for the keys defaultpriv and limitpriv. The keyword type can be specified with the value role or the value normal. When using the value role, the account changes from a nor- mal user to a role; using the value normal keeps the account a normal user. As a role account, no roles (-R or roles=value) can be present. -l new_logname Specify the new login name for the user. See passwd(4) for the requirements for usernames. -m Move the user's home directory to the new directory specified with the -d option. If the directory already exists, it must have permis- sions read/write/execute by group, where group is the user's primary group. -o This option allows the specified UID to be duplicated (non-unique). -P profile One or more comma-separated rights profiles defined in prof_attr(4). This replaces any existing profile setting in user_attr(4). If an empty profile list is specified, the existing setting is removed. -R role One or more comma-separated roles (see roleadd(1M)). This replaces any existing role setting. If no role list is specified, the exist- ing setting is removed. -s shell Specify the full pathname of the program that is used as the user's shell on login. The value of shell must be a valid executable file. -u uid Specify a new UID for the user. It must be a non-negative decimal integer less than MAXUID as defined in <param.h>. The UID associated with the user's home directory is not modified with this option; a user will not have access to their home directory until the UID is manually reassigned using chown(1). OPERANDS
The following operands are supported: login An existing login name to be modified. EXAMPLES
Example 1 Assigning Privileges to a User The following command adds the privilege that affects high resolution times to a user's initial, inheritable set of privileges. # usermod -K defaultpriv=basic,proc_clock_highres jdoe This command results in the following entry in user_attr: jdoe::::type=normal;defaultpriv=basic,proc_clock_highres Example 2 Removing a Privilege from a User's Limit Set The following command removes the privilege that allows the specified user to create hard links to directories and to unlink directories. # usermod -K limitpriv=all,!sys_linkdir jdoe This command results in the following entry in user_attr: jdoe::::type=normal;defaultpriv=basic,limitpriv=all,!sys_linkdir Example 3 Removing a Privilege from a User's Basic Set The following command removes the privilege that allows the specified user to examine processes outside the user's session. # usermod -K defaultpriv=basic,!proc_session jdoe This command results in the following entry in user_attr: jdoe::::type=normal;defaultpriv=basic,!proc_session;limitpriv=all Example 4 Assigning a Role to a User The following command assigns a role to a user. The role must have been created prior to this command, either through use of the Solaris Management Console GUI or through roleadd(1M). # usermod -R mailadm jdoe This command results in the following entry in user_attr: jdoe::::type=normal;roles=mailadm;defaultpriv=basic;limitpriv=all Example 5 Removing All Profiles from a User The following command removes all profiles that were granted to a user directly. The user will still have any rights profiles that are granted by means of the PROFS_GRANTED key in policy.conf(4). # usermod -P "" jdoe EXIT STATUS
In case of an error, usermod prints an error message and exits with one of the following values: 2 The command syntax was invalid. A usage message for the usermod command is displayed. 3 An invalid argument was provided to an option. 4 The uid given with the -u option is already in use. 5 The password files contain an error. pwconv(1M) can be used to correct possible errors. See passwd(4). 6 The login to be modified does not exist, the group does not exist, or the login shell does not exist. 8 The login to be modified is in use. 9 The new_logname is already in use. 10 Cannot update the /etc/group or /etc/user_attr file. Other update requests will be implemented. 11 Insufficient space to move the home directory (-m option). Other update requests will be implemented. 12 Unable to complete the move of the home directory to the new home directory. FILES
/etc/group system file containing group definitions /etc/datemsk system file of date formats /etc/passwd system password file /etc/shadow system file containing users' encrypted passwords and related information /etc/user_attr system file containing additional user and role attributes ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
chown(1), passwd(1), users(1B), groupadd(1M), groupdel(1M), groupmod(1M), logins(1M), pwconv(1M), roleadd(1M), roledel(1M), rolemod(1M), useradd(1M), userdel(1M), getdate(3C), auth_attr(4), passwd(4), policy.conf(4), prof_attr(4), user_attr(4), attributes(5) NOTES
The usermod utility modifies passwd definitions only in the local /etc/passwd and /etc/shadow files. If a network nameservice such as NIS or NIS+ is being used to supplement the local files with additional entries, usermod cannot change information supplied by the network nameservice. However usermod will verify the uniqueness of user name and user ID against the external nameservice. The usermod utility uses the /etc/datemsk file, available with SUNWaccr, for date formatting. SunOS 5.11 22 Feb 2008 usermod(1M)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy