Shell Script Password Change

Discussion in 'Software' started by Mada_Milty, Jun 15, 2007.

  1. Mada_Milty

    Mada_Milty MajorGeek

    Good Day,

    After figuring out a problem I had adding users to my edgy eft FTP server (described in this thread), I want to write a shell script that creates a user, and then automatically resets that users password. So far, I've got this:

    Code:
    #!/bin/sh
    
    sudo useradd $1 -p $2 -d /home/$1 -m
    And this works well, but I would like to immediately reset this new user's password.

    Are there switches to make passwd NOT prompt for the OLD password to be entered?

    I've also tried with chpasswd, but that seemed to just hang.

    Can anyone suggest any other methods?

    Thanks,

    Milty
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    Alright - scratch it

    I'll just use

    Code:
    sudo passwd [I]username[/I]
    Only a small extra step.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds