Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 01-22-2005, 12:40 PM   #1
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Rep: Reputation: 18
set logon password without useradd?


I'm writing some script to automagically create a new useraccount.
I want the script to run with two parameters, the username and his password. Now to create the user account is no problem at all but to set the password without the prompt asking it, is that possible?
The goal is that the script can run without any interactive user input. Is it possible to have the script provide the input for the passwd?

Old 01-22-2005, 02:03 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
You could use an expect script with passwd.
Old 01-22-2005, 08:12 PM   #3
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
What is an expect script? I assume it's some kind of script that sends text to the passwd command? But can you give away a hint? I tried with input redirection like passwd < pwdfile < pwdfile but ofcourse that didn't work. :-)

Ok.. sry, I should have checked it immediatly. expect seems to be the command that I was looking for.


Last edited by ldp; 01-23-2005 at 05:41 AM.


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
useradd without shadow password twallstr Linux - Software 1 09-08-2005 03:14 PM
Password Problems With useradd Jude Lucien Debian 4 08-18-2005 11:44 AM
Logon (telnet) to RedHat ES 3.0 bypassing password amutrl Linux - Newbie 2 05-18-2005 07:12 AM
logon and password recovery Ron Moroney Linux - Newbie 5 04-08-2005 02:15 PM
Help with password logon window wardialer Linux - Newbie 3 04-08-2005 03:24 AM

All times are GMT -5. The time now is 11:37 AM.

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