LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-20-2008, 04:40 PM   #1
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
How to set password from script?


I want to create a user, then generate a temperory password for the user automatically from a script. I don't want the prompt from passwd command print on the screen and wait for the user to enter new password. I want to use a script to set the user's password. How can I do this?

Thanks.
 
Old 02-20-2008, 04:57 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 31
Code:
echo -e "password\npassword" | passwd USER
sends password twice to the input stream of passwd
Code:
passwd USER < echo -e "password\npassword"
should also work
 
Old 02-20-2008, 05:11 PM   #3
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
It works, thanks a lot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set variables in a bash script; ansi PS1 color script donnied Programming 4 11-21-2007 12:33 PM
How to set login and password and root password in suse 10.2 sirius57 SUSE / openSUSE 8 07-24-2007 10:51 AM
change Root Password even if the password in the grub is also set sheelnidhi Linux - General 6 08-30-2006 08:27 AM
HOW-TO? Create User, Set Password with script longtex SUSE / openSUSE 13 10-02-2005 03:35 PM


All times are GMT -5. The time now is 11:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration