Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Modify the administrator's initial password for submin

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

After installing the new version of submin2.2.2, due to the need to send the admin password through the local machine, but the machine does not have sendmail or is blocked by the mailbox as spam, resulting in unable to receive the admin password, which can be modified through the program

/ usr/lib/python2.7/site-packages/submin/plugins/storage/sqlvi passwd.py

Enter the script as follows

Import submin.plugins.storage.sql.common as storagefrom submin.models.exceptions import UserExistsError, NoMD5PasswordErrorfrom submin.auth import md5cryptfrom sys import argv script,inputPassword = argvdef _ pw_hash (password, salt=None, magic='apr1'): if salt is None: salt= md5crypt.makesalt () newhash = md5crypt.md5crypt (password, salt,'$'+ magic +'$') return newhashpassword = inputPasswordpassword = _ pw_hash (password) print password

Execute script

[root@localhost sql] # python2 passwd.py 123456 $apr1 $ahzk2phT$FROlECwi3g5wPQEjflSFq0 [root@localhost sql] #

Change the password of admin

Cd / xxx/submin/conf/ sqlite3 submin.db sqlite3 > update user set password='$apr1 $ahzk2phT$FROlECwi3g5wPQEjflSFq0' where name='admin'

After modification, log in again.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 268

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report