您好,登錄后才能下訂單哦!
安裝新版的submin2.2.2后,由于需要通過(guò)本機(jī)發(fā)送admin的密碼,但是本機(jī)沒(méi)有sendmail或者是發(fā)送后被郵箱當(dāng)成垃圾郵件攔截掉了,因此導(dǎo)致無(wú)法收到admin的密碼,這個(gè)可以通過(guò)程序進(jìn)行修改
/usr/lib/python2.7/site-packages/submin/plugins/storage/sql vi passwd.py
輸入腳本如下
import submin.plugins.storage.sql.common as storage from submin.models.exceptions import UserExistsError, NoMD5PasswordError from submin.auth import md5crypt from sys import argv script,inputPassword = argv def _pw_hash(password, salt=None, magic='apr1'): if salt is None: salt = md5crypt.makesalt() newhash = md5crypt.md5crypt(password, salt, '$' + magic + '$') return newhash password = inputPassword password = _pw_hash(password) print password
執(zhí)行腳本
[root@localhost sql]# python2 passwd.py 123456 $apr1$ahzk2phT$FROlECwi3g5wPQEjflSFq0 [root@localhost sql]#
修改admin的密碼
cd /xxx/submin/conf/ sqlite3 submin.db sqlite3> update user set password='$apr1$ahzk2phT$FROlECwi3g5wPQEjflSFq0' where name='admin'
修改后重新登錄即可
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。