• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

retrieve passwords in plain text from psa DB

S

sys_user

Guest
Hello,

Passwords are encrypted and I cannot retreive them with:
use psa;
select * from sys_users,accounts where accounts.id=sys_users.id and sys_users.login='username';
+-----+-------------+------------+--------------------------------+-----------+-------+-----+-------+------------+
| id | login | account_id | home | shell | quota | id | type | password |
+-----+-------------+------------+--------------------------------+-----------+-------+-----+-------+------------+
| 104 | username | 391 | /var/www/vhosts/username.coml | /bin/bash | 0 | 104 | plain | 3WcHfBOlmA |
+-----+-------------+------------+--------------------------------+-----------+-------+-----+-------+------------+


this password don't match FTP/SSH login that I have provided during creation of domain.

Please note that accounts table show me that passwords are stored in plain text.

mysql> select * from accounts where id='104';
+-----+-------+------------+
| id | type | password |
+-----+-------+------------+
| 104 | plain | 3WcHfBOlmA |
+-----+-------+------------+
 
Hello,

From the sql query you posted, it seems the id you need to select in table accounts is 391, and not 104.

The field 'account_id' in the table 'sys_users' correspond to the field 'id' in the table 'accounts'. So try

mysql> select * from accounts where id='391';

Cheers
 
Either way, the aren't. They are plain text, thats for sure.
 
Some handy queries

Here are some handy queries for getting usernames and passwords for different things in the PSA database. Hope this helps some people (replace yourdomain.com with the domain you are looking up info for):

Client Info (Plesk and SSH Login)
SELECT clients.login, clients.cname, clients.email, accounts.password FROM domains LEFT JOIN clients ON domains.cl_id = clients.id LEFT JOIN accounts ON clients.account_id = accounts.id WHERE domains.name = 'yourdomain.com';

System Info (FTP Login)
SELECT sys_users.login, accounts.password, sys_users.home, sys_users.shell FROM domains RIGHT JOIN hosting ON domains.id = hosting.dom_id LEFT JOIN sys_users ON hosting.sys_user_id = sys_users.id LEFT JOIN accounts ON sys_users.account_id = accounts.id WHERE domains.name = 'yourdomain.com';

Database Info
SELECT data_bases.name, db_users.login, accounts.password FROM domains RIGHT JOIN data_bases ON domains.id = data_bases.dom_id RIGHT JOIN db_users ON data_bases.id = db_users.db_id LEFT JOIN accounts ON db_users.account_id = accounts.id WHERE domains.name = 'yourdomain.com';

Email Info
SELECT mail.mail_name, accounts.password FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id WHERE domains.name = 'yourdomain.com';
 
Email Info
SELECT mail.mail_name, accounts.password FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id WHERE domains.name = 'yourdomain.com';

Hi mediashaker,

Using this query I keep getting "[BLOB - 12 Bytes]" in my password row.
Anything I'm doing wrong?
 
Back
Top