打开对应的数据库,找到存放用户的user表
sqlite3 /home/git/gogs/data/gogs.db
执行更新语句即可,以下哈希对应的密码是 123456
update user set passwd='b4af39cca17a2231fead3c06908d352fd367c123fceb7256caeedf032b0d87c8a00a0e86a72f1003622baccbaa6cb511ea57',rands='FPU4fPdLbK',salt='6sQ8yJ1aGz' where name='root';