Changing password of postfix user account directly in MySQL database
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.
Here is the table:
SELECT username,password FROM mailbox LIMIT 1;
+------------------+------------------------------------+
| username | password |
+------------------+------------------------------------+
| user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
+------------------+------------------------------------+
What format is it? How to change it?
mysql postfix
add a comment |
up vote
3
down vote
favorite
I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.
Here is the table:
SELECT username,password FROM mailbox LIMIT 1;
+------------------+------------------------------------+
| username | password |
+------------------+------------------------------------+
| user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
+------------------+------------------------------------+
What format is it? How to change it?
mysql postfix
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.
Here is the table:
SELECT username,password FROM mailbox LIMIT 1;
+------------------+------------------------------------+
| username | password |
+------------------+------------------------------------+
| user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
+------------------+------------------------------------+
What format is it? How to change it?
mysql postfix
I need to change a password of a postfix user account mailbox directly in a MySQL database; however I have no idea of the format used.
Here is the table:
SELECT username,password FROM mailbox LIMIT 1;
+------------------+------------------------------------+
| username | password |
+------------------+------------------------------------+
| user@example.com | $1$60Dgu9vc$T7vaQfTKgxUpci0TTnsyO0 |
+------------------+------------------------------------+
What format is it? How to change it?
mysql postfix
mysql postfix
edited Jan 8 at 9:11
asked May 26 '17 at 19:43
Rui F Ribeiro
38.1k1475123
38.1k1475123
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
The $1$
at the beginning of the password field hints it is a MD5 hash.
To encrypt a password in a MD5 hash, you can use the openssl passwd
command.
From man openssl:
passwd Generation of hashed passwords.
and from openssl passwd --help
:
-1 MD5-based password algorithm
-stdin read passwords from stdin
So to generate the MD5 hash, a short bash example:
#/bin/bash
PASSWORD="test123"
MD5=`echo $PASSWORD | openssl passwd -1 -stdin`
Running it, you got as output the intended encrypted password:
$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/
So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:
USE postfix
UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";
The change takes effect immediately, and the user will notice the change in the next mailbox access.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
The $1$
at the beginning of the password field hints it is a MD5 hash.
To encrypt a password in a MD5 hash, you can use the openssl passwd
command.
From man openssl:
passwd Generation of hashed passwords.
and from openssl passwd --help
:
-1 MD5-based password algorithm
-stdin read passwords from stdin
So to generate the MD5 hash, a short bash example:
#/bin/bash
PASSWORD="test123"
MD5=`echo $PASSWORD | openssl passwd -1 -stdin`
Running it, you got as output the intended encrypted password:
$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/
So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:
USE postfix
UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";
The change takes effect immediately, and the user will notice the change in the next mailbox access.
add a comment |
up vote
3
down vote
accepted
The $1$
at the beginning of the password field hints it is a MD5 hash.
To encrypt a password in a MD5 hash, you can use the openssl passwd
command.
From man openssl:
passwd Generation of hashed passwords.
and from openssl passwd --help
:
-1 MD5-based password algorithm
-stdin read passwords from stdin
So to generate the MD5 hash, a short bash example:
#/bin/bash
PASSWORD="test123"
MD5=`echo $PASSWORD | openssl passwd -1 -stdin`
Running it, you got as output the intended encrypted password:
$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/
So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:
USE postfix
UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";
The change takes effect immediately, and the user will notice the change in the next mailbox access.
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
The $1$
at the beginning of the password field hints it is a MD5 hash.
To encrypt a password in a MD5 hash, you can use the openssl passwd
command.
From man openssl:
passwd Generation of hashed passwords.
and from openssl passwd --help
:
-1 MD5-based password algorithm
-stdin read passwords from stdin
So to generate the MD5 hash, a short bash example:
#/bin/bash
PASSWORD="test123"
MD5=`echo $PASSWORD | openssl passwd -1 -stdin`
Running it, you got as output the intended encrypted password:
$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/
So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:
USE postfix
UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";
The change takes effect immediately, and the user will notice the change in the next mailbox access.
The $1$
at the beginning of the password field hints it is a MD5 hash.
To encrypt a password in a MD5 hash, you can use the openssl passwd
command.
From man openssl:
passwd Generation of hashed passwords.
and from openssl passwd --help
:
-1 MD5-based password algorithm
-stdin read passwords from stdin
So to generate the MD5 hash, a short bash example:
#/bin/bash
PASSWORD="test123"
MD5=`echo $PASSWORD | openssl passwd -1 -stdin`
Running it, you got as output the intended encrypted password:
$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/
So to change the password in the MySQL DB to 'test123', you do in the MySQL prompt:
USE postfix
UPDATE mailbox SET password="$1$EaYOC8n4$04LSDBtt4A8GPVRUkzBXG/" WHERE username="user@example.com";
The change takes effect immediately, and the user will notice the change in the next mailbox access.
edited yesterday
answered May 26 '17 at 19:43
Rui F Ribeiro
38.1k1475123
38.1k1475123
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f367480%2fchanging-password-of-postfix-user-account-directly-in-mysql-database%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown