Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-12-2010
Registered User
 

Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question 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
Sponsored Links
    #2  
Old 03-12-2010
Registered User
 

Join Date: Oct 2007
Location: Dallas, Texas
Posts: 67
Thanks: 0
Thanked 2 Times in 2 Posts
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.
Sponsored Links
    #3  
Old 03-12-2010
Registered User
 

Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
    #4  
Old 03-12-2010
Registered User
 

Join Date: Oct 2007
Location: Dallas, Texas
Posts: 67
Thanks: 0
Thanked 2 Times in 2 Posts
If the expire value has made its way into the /etc/shadow file then it should be preserved between password changes.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
set password not to expire itik Red Hat 0 04-06-2009 02:57 PM
Set Password Never Expire shamsul Solaris 2 04-10-2007 12:28 PM
Password expire sharif Shell Programming and Scripting 1 02-18-2007 05:52 AM
Telnet session does not expire deepsteptom Shell Programming and Scripting 1 08-03-2004 11:48 AM
password will expire Erwin Stocker UNIX for Advanced & Expert Users 8 02-28-2003 03:39 PM



All times are GMT -4. The time now is 03:39 AM.