Modify the password via usermod -p

Since I wasted too much time behind this, here is how to do it in 2 steps:

1. Retrieve the crypted password

openssl passwd Your_Password

2. Copy and paste the output to your usermod call

usermod -p openssl_output user_name



4 thoughts on “Modify the password via usermod -p

  1. #!/bin/bash

    while read ligne
    set $(echo $ligne)
    dom=$(eval echo $1)
    login=$(eval echo $2)
    passwd=$(eval echo $3)

    echo “*******************”
    PASSWORD=$(eval echo $3)
    LOGIN=$(eval echo $2)

    echo -e “$dom\n$LOGIN\n$PASSWORD\n”

    pass=$(openssl passwd $PASSWORD)

    usermod -p $pass $LOGIN

    echo $LOGIN
    echo $pass
    echo “*******************”

    done < fich.txt

Your opinion is important!

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s