0

I'm clear about everything except how to set password using the script. Normally, I would write:

passwd username

And the terminal would prompt for password. How to read password from file instead?

2
  • 1
    Duplicate of stackoverflow.com/questions/714915/… ? Commented Nov 20, 2010 at 9:37
  • Thanks a bunch. My question is already answered! Commented Nov 20, 2010 at 9:43

1 Answer 1

2

You can use:

passwd --stdin username < filename

From passwd(1):

--stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.