Operating System - HP-UX
1825719 Members
3143 Online
109686 Solutions
New Discussion

Re: adding temporary user accounts

 
Sandra R.
Occasional Contributor

adding temporary user accounts

what's the best way to create a temporary account for a new user?
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: adding temporary user accounts

You can either go through SAM or user the 'useradd' command.

# man useradd

for more information.
Michael Tully
Honored Contributor

Re: adding temporary user accounts

If your using a trusted system you can set up an account through SAM that has an account lifetime in number of days. Other than that you will need to use 'useradd' and include the '-e' option.
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: adding temporary user accounts

Hi,

Just type 'useradd' and it will print the options. For ex., to create a user 'temp' with uid 11111 and a pre-existing group 'tmpgrp' expiring by July 17th would be

useradd -u 11111 -g users -c "Temp user" -s /usr/bin/ksh -m -k /etc/skel -e 07/16/03 tmp


You can also do it much easily with SAM.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Fragon
Trusted Contributor

Re: adding temporary user accounts

Use "useradd" with "-e" parameter!
Rajeev  Shukla
Honored Contributor

Re: adding temporary user accounts

Also conside -f option with useradd command. This is the inactivity time. So if you have created a temporary account and the user loges in every day then its fine and if he doesn't login say for ten days which you have specified as the inactive time the account will expire also that means the temporary account is no longer required if he hasn't used for 10 days.

Rajeev
twang
Honored Contributor

Re: adding temporary user accounts

Yes, it is easy to add a user using SAM or useradd command, since it is a temporary account, I usually specifies the date on which this login can no longer be used. After expire, no user will be able to access this login.