Expire Command | Need Help

Hi ,

I am trying to execute the ipl file as below :

my $user="iwadmin";
chomp $user;
system("passwd -x 29 $user");

The ipl file executes with out any issues when i have logged in as root in solaris .but when when i try to execute the same file with other user id ie iwadmin ,it says permission denied

How can i run the ipl while as iwadmin with out getting any permission denied error ? Please help

Abhishek

Only a privileged user can run the 'passwd -x' command on Solaris. User 'iwadmin'
does not have the necessary privilege to run this command.

The 'usermod' command can be used to change user privileges. Please work with your
sysadmin to see if 'iwadmin' should be given the privilege to run the command.

Alternatively, you can modify the script to fail with a nice error message if a
non-root user tries to execute it.

Hi Yes true what you say , but we need to able to set expiry of a user id when ever the user resets or changes his/her password , is there any work around for the same , so that which ever user re sets his password , the expire command is automatically executed for that user

what about expect command or sudoers , will this help ?

Abhishek

If the expire value has made its way into the /etc/shadow file then it should be preserved between password changes.