Modify the administrator's initial password for submin
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.