Find the answer to your Linux question:
Results 1 to 5 of 5
Hello all. I am working on a project to write a script in Perl to set a random password on a remote host and am looking for ways to make ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3

    Expiring Password


    Hello all.

    I am working on a project to write a script in Perl to set a random password on a remote host and am looking for ways to make the password expire after a set period of time. I posted on the Perl forums and they referred me to this site.

    In the scipt, I simply ssh into the host and then simply run a 'passwd' for the user name I am generating a password for. I wanted to use one of the arguments for 'passwd' to make it expire after 1 day (such as 'password -x -1 [username]'), but I do not have the account priveleges, and I do not believe the script will be run on root.

    Are there any other ways I can reset the password remotely after a set period of time?

    OR is there a way to automatically create a one-time password that expires after login?

    Thanks in advance!

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Hi,

    The command that springs to mind regarding password expiry is chage, however you need root permissions to use that one.

    You might want to have a read through this to see if you can get the desired results by changing the default login settings
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    I looked into chage, but unfortunately, I won't be able to use this either.

    Another thing I might mention is that the password would need to be changed within the hour it was set.

    I don't know of any commands that will allow you to set a password to expire so soon? The only things I can think of is simply having the program wait for a little bit before changing the password?

    Any other ways to accomplish this?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Did you look at the link in my previous post?
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  6. #5
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    Quote Originally Posted by matonb View Post
    Did you look at the link in my previous post?
    Yeah, i took a look at the link, but unfortuantely, I would need to expire the password within the hour it is set.

    I wonder if I'll have to write some code to check time-stamps and then do an action?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •