Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to set up a large number of local user accounts on a number of machines running Ubuntu, and I need a way to script the password setting. These machines use /etc/shadow, as is the default in the installation. passwd doesn't take a password as argument, and usermod wants the password in encrypted form.

The best way I have found is to write a separate C program to use crypt to encrypt the passwords, and then use usermod to set them in /etc/shadow.

But is there some other way I can script password setting like this, that at least doesn't require me to do parts of it in C? It seems to me there must be some command I don't know about?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

man newusers

read this and this

share|improve this answer
    
Ah, so there was a command for this that I didn't know about. Thanks! –  Thomas Padron-McCarthy Sep 27 '09 at 8:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.