Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, Is there a way in which we can provide input to the /usr/bin/passwd command so that it accepts the password rather than prompt everytime. Basically I want to run ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    May 2003
    Location
    CA
    Posts
    370

    passwd command on redhat


    Hi,

    Is there a way in which we can provide input to the /usr/bin/passwd command so that it accepts the password rather than prompt everytime.
    Basically I want to run it in a shell script and automate password generation rather then prompting me everytime for a new password.
    I tried

    echo $pword | /usr/bin/passwd
    but it does not work, where pword has my text password.

    Thanks,
    Nik

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Use passwd --stdin.

  3. #3
    Linux User
    Join Date
    May 2003
    Location
    CA
    Posts
    370
    cool...thanks.
    any idea what the equivalent is on a solaris box?

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Sorry, I haven't used Solaris. Check the manpage, though.

  5. #5
    Just Joined!
    Join Date
    Jul 2003
    Location
    UT Austin,TX, USA
    Posts
    10
    Quote Originally Posted by nikhil
    cool...thanks.
    any idea what the equivalent is on a solaris box?
    Try passwd -

Posting Permissions

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