最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Openfire重新安装后无法用管理员账户admin登陆

Openfire crifan 5056浏览 0评论

【背景】

折腾:

【记录】重新生成Openfire的全小写的MySQL数据库表项

期间,使用正确的:

用户名:admin

密码:root

去登陆,结果无法登陆:

Login failed: make sure your username and password are correct and that you're an admin or moderator.

如图:

openfire admin root login fail

【解决过程】

1.此处,重启Openfire也还是不行:

root@bogon:~# service openfire restart
Shutting down openfire:                                    [  OK  ]
Starting openfire: 

2.搜:

reinstall openfire admin cannot login

参考:

Why can’t I login to my Openfire administration console after initial installation? – Stack Overflow

但是我此处已经确保是在我安装期间所输入的密码:root,但是无法登陆。

3.xmpp – Openfire Installation Issue – Can’t Login to admin panel – Server Fault

再去重启远程所在的CentOS服务器。不行。

4.搜:

openfire Login failed: make sure your username and password are correct and that you’re an admin or moderator

参考:

Please resolve my problems: SOLVED : Openfire Server Administrator Password doesn’t work after install

How To Recover Openfire admin Password

可以进入数据库看到加密后的密码:

root@bogon:~# mysql -u root -p openfire_aaaaaaaaaaaa
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22075
Server version: 5.5.44-cll-lve MySQL Community Server (GPL) by Atomicorp

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+------------------------------+
| Tables_in_openfire_aaaaaaaaaaaa |
+------------------------------+
| ofextcomponentconf           |
| ofgroup                      |
| ofgroupprop                  |
| ofgroupuser                  |
| ofid                         |
| ofmucaffiliation             |
| ofmucconversationlog         |
| ofmucmember                  |
| ofmucroom                    |
| ofmucroomprop                |
| ofmucservice                 |
| ofmucserviceprop             |
| ofoffline                    |
| ofpresence                   |
| ofprivacylist                |
| ofprivate                    |
| ofproperty                   |
| ofpubsubaffiliation          |
| ofpubsubdefaultconf          |
| ofpubsubitem                 |
| ofpubsubnode                 |
| ofpubsubnodegroups           |
| ofpubsubnodejids             |
| ofpubsubsubscription         |
| ofremoteserverconf           |
| ofroster                     |
| ofrostergroups               |
| ofsaslauthorized             |
| ofsecurityauditlog           |
| ofuser                       |
| ofuserflag                   |
| ofuserprop                   |
| ofvcard                      |
| ofversion                    |
+------------------------------+
34 rows in set (0.00 sec)

mysql> select password from jiveUser where username = 'admin';
ERROR 1146 (42S02): Table 'openfire_aaaaaaaa.jiveuser' doesn't exist
mysql> select password from ofuser where username = 'admin';     
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> show table ofuser;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ofuser' at line 1
mysql> SELECT * FROM ofUser;
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
| username | plainPassword | encryptedPassword                                | name          | email       | creationDate    | modificationDate |
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
| admin    | NULL          | 76424d3313817850b70f1f05ecfac9bcd42c654553229642 | Administrator | admin@bogon | 001436297683687 | 0                |
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
1 row in set (0.00 sec)

mysql> 

5.搜:

openfire admin password

参考:

linux – Openfire admin password reset – Server Fault

去:

mysql> UPDATE ofUser SET encryptedPassword='admin' WHERE username='admin';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM ofUser;
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| username | plainPassword | encryptedPassword | name          | email       | creationDate    | modificationDate |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| admin    | NULL          | admin             | Administrator | admin@bogon | 001436297683687 | 0                |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
1 row in set (0.00 sec)

mysql> 

然后再去用

admin

admin

登陆试试,还是不行。

6.再去重置密码,然后再去登陆试试:

mysql> SELECT * FROM ofUser;
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| username | plainPassword | encryptedPassword | name          | email       | creationDate    | modificationDate |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| admin    | NULL          | NULL              | Administrator | admin@bogon | 001436297683687 | 0                |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
1 row in set (0.00 sec)

mysql> exit
Bye
root@bogon:~# service openfire restart;
Shutting down openfire:                                    [  OK  ]
Starting openfire: 
root@bogon:~# 

还是不行。

7.再去设置明密码为admin:

mysql> UPDATE ofUser SET plainPassword='admin' WHERE username='admin';
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM ofUser;
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| username | plainPassword | encryptedPassword | name          | email       | creationDate    | modificationDate |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
| admin    | admin         | NULL              | Administrator | admin@bogon | 001436297683687 | 0                |
+----------+---------------+-------------------+---------------+-------------+-----------------+------------------+
1 row in set (0.00 sec)

mysql> 

结果,还是不行。

8.把之前添加的:

/opt/openfire/conf/openfire.xml

中那个jdbcProvider暂时去掉:

结果发现现在里面根本没有:

remove old jdbcProvider in openfire xml config

所以无需去除了。

9.此处由于暂不方便重启物理的CentOS服务器。

所以暂时去,卸载Openfire,然后重新安装Openfire,看看能否解决admin无法登陆的问题。

先去卸载Openfire,并彻底删除Openfire相关的东西:

root@bogon:~# yum --help
Loaded plugins: fastestmirror
Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade      downgrade a package
erase          Remove a package or packages from your system
groupinfo      Display details about a package group
groupinstall   Install the packages in a group on your system
grouplist      List available package groups
groupremove    Remove the packages in a group from your system
help           Display a helpful usage message
history        Display, or use, the transaction history
info           Display details about a package or group of packages
install        Install a package or packages on your system
list           List a package or groups of packages
load-transaction load a saved transaction from filename
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repolist       Display the configured software repositories
resolvedep     Determine which package provides the given dependency
search         Search package details for the given string
shell          Run an interactive yum shell
update         Update a package or packages on your system
upgrade        Update packages taking obsoletes into account
version        Display a version for the machine and/or available repos.


Options:
  -h, --help            show this help message and exit
  -t, --tolerant        be tolerant of errors
  -C, --cacheonly       run entirely from system cache, don't update cache
  -c [config file], --config=[config file]
                        config file location
  -R [minutes], --randomwait=[minutes]
                        maximum command wait time
  -d [debug level], --debuglevel=[debug level]
                        debugging output level
  --showduplicates      show duplicates, in repos, in list/search commands
  -e [error level], --errorlevel=[error level]
                        error output level
  --rpmverbosity=[debug level name]
                        debugging output level for rpm
  -q, --quiet           quiet operation
  -v, --verbose         verbose operation
  -y, --assumeyes       answer yes for all questions
  --version             show Yum version and exit
  --installroot=[path]  set install root
  --enablerepo=[repo]   enable one or more repositories (wildcards allowed)
  --disablerepo=[repo]  disable one or more repositories (wildcards allowed)
  -x [package], --exclude=[package]
                        exclude package(s) by name or glob
  --disableexcludes=[repo]
                        disable exclude from main, for a repo or for
                        everything
  --obsoletes           enable obsoletes processing during updates
  --noplugins           disable Yum plugins
  --nogpgcheck          disable gpg signature checking
  --disableplugin=[plugin]
                        disable plugins by name
  --enableplugin=[plugin]
                        enable plugins by name
  --skip-broken         skip packages with depsolving problems
  --color=COLOR         control whether color is used
  --releasever=RELEASEVER
                        set value of $releasever in yum config and repo files
  --setopt=SETOPTS      set arbitrary config and repo options

  Plugin Options:
root@bogon:~# yum list openfire
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
 * base: mirrors.btte.net
 * extras: mirrors.163.com
 * updates: mirrors.163.com
atomic                                                                                                       | 3.4 kB     00:00  
base                                                                                                         | 3.7 kB     00:00    
extras                                                                                                       | 3.4 kB     00:00    
updates                                                                                                      | 3.4 kB     00:00 
Installed Packages
openfire.i386                                           3.10.2-1                                            @/openfire-3.10.2-1.i386
root@bogon:~# ls -la
total 72
dr-xr-x---.  3 root root 4096 Jul  8 04:15 .
dr-xr-xr-x. 22 root root 4096 Jun  4 07:01 ..
-rw-------.  1 root root 1343 Jun  4 02:35 anaconda-ks.cfg
-rw-------.  1 root root 9507 Jul  7 21:09 .bash_history
-rw-r--r--.  1 root root   18 May 20  2009 .bash_logout
-rw-r--r--.  1 root root  176 May 20  2009 .bash_profile
-rw-r--r--   1 root root  471 Jul  7 06:42 .bashrc
-rw-r--r--.  1 root root  100 Sep 23  2004 .cshrc
drwxr-xr-x   2 root root 4096 Jul  7 06:42 develop
-rw-r--r--.  1 root root 9562 Jun  4 02:35 install.log
-rw-r--r--.  1 root root 3161 Jun  4 02:34 install.log.syslog
-rw-------   1 root root 1088 Jul  8 04:15 .mysql_history
-rw-r--r--.  1 root root  129 Dec  4  2004 .tcshrc
-rw-------   1 root root 2630 Jul  7 21:09 .viminfo
root@bogon:~# ls develop/openfire-3.10.2-1.i386.rpm -la
-rw-r--r-- 1 root root 68802464 Jun 23 01:54 develop/openfire-3.10.2-1.i386.rpm
root@bogon:~# yum erase openfire.i386
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package openfire.i386 0:3.10.2-1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                     Arch                    Version                      Repository                           Size
====================================================================================================================================
Removing:
 openfire                    i386                    3.10.2-1                     @/openfire-3.10.2-1.i386     179 M

Transaction Summary
====================================================================================================================================
Remove        1 Package(s)

Installed size: 179 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : openfire-3.10.2-1.i386                                                                                       1/1 
Shutting down openfire: [  OK  ]
warning: /opt/openfire/resources/security/truststore saved as /opt/openfire/resources/security/truststore.rpmsave
warning: /opt/openfire/resources/security/keystore saved as /opt/openfire/resources/security/keystore.rpmsave
warning: /opt/openfire/conf/security.xml saved as /opt/openfire/conf/security.xml.rpmsave
warning: /opt/openfire/conf/openfire.xml saved as /opt/openfire/conf/openfire.xml.rpmsave
  Verifying  : openfire-3.10.2-1.i386                                                                                      1/1 

Removed:
  openfire.i386 0:3.10.2-1                                                                                                     

Complete!
root@bogon:~# ls /opt/openfire/
conf/      logs/      plugins/   resources/ 
root@bogon:~# rm /opt/openfire/ 
rm: cannot remove `/opt/openfire/': Is a directory
root@bogon:~# rm -fr /opt/openfire/ 
root@bogon:~# 

然后接着重新安装:

root@bogon:~# yum install develop/openfire-3.10.2-1.i386.rpm 
Loaded plugins: fastestmirror
Setting up Install Process
Examining develop/openfire-3.10.2-1.i386.rpm: openfire-3.10.2-1.i386
Marking develop/openfire-3.10.2-1.i386.rpm to be installed
Loading mirror speeds from cached hostfile
 * atomic: mirrors.hosting.in.th
 * base: mirrors.btte.net
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package openfire.i386 0:3.10.2-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                     Arch                    Version                       Repository                          Size
====================================================================================================================================
Installing:
 openfire                    i386                    3.10.2-1                      /openfire-3.10.2-1.i386        179 M

Transaction Summary
====================================================================================================================================
Install       1 Package(s)

Total size: 179 M
Installed size: 179 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : openfire-3.10.2-1.i386                                                                                      1/1 
  Verifying  : openfire-3.10.2-1.i386                                                                                      1/1 

Installed:
  openfire.i386 0:3.10.2-1                                                                                                     

Complete!
root@bogon:~# service openfire start
Starting openfire: 
root@bogon:~# service openfire status
openfire is running

打开页面:

http://1.2.3.4:9090

重新去安装。安装完毕后再去登陆管理控制台:

http://1.2.3.4:9090/login.jsp

admin

admin

终于可以登陆进去了:

use admin admin can login openfire control panel

然后再去mysql数据库中看admin的密码,果然是正常的加密的了:

root@bogon:~# mysql -u root -p openfire_aaaaa
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22703
Server version: 5.5.44-cll-lve MySQL Community Server (GPL) by Atomicorp

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+------------------------------+
| Tables_in_openfire_aaaaa |
+------------------------------+
| ofextcomponentconf           |
| ofgroup                      |
| ofgroupprop                  |
| ofgroupuser                  |
| ofid                         |
| ofmucaffiliation             |
| ofmucconversationlog         |
| ofmucmember                  |
| ofmucroom                    |
| ofmucroomprop                |
| ofmucservice                 |
| ofmucserviceprop             |
| ofoffline                    |
| ofpresence                   |
| ofprivacylist                |
| ofprivate                    |
| ofproperty                   |
| ofpubsubaffiliation          |
| ofpubsubdefaultconf          |
| ofpubsubitem                 |
| ofpubsubnode                 |
| ofpubsubnodegroups           |
| ofpubsubnodejids             |
| ofpubsubsubscription         |
| ofremoteserverconf           |
| ofroster                     |
| ofrostergroups               |
| ofsaslauthorized             |
| ofsecurityauditlog           |
| ofuser                       |
| ofuserflag                   |
| ofuserprop                   |
| ofvcard                      |
| ofversion                    |
+------------------------------+
34 rows in set (0.00 sec)

mysql> SELECT * from ofuser;
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
| username | plainPassword | encryptedPassword                                | name          | email       | creationDate    | modificationDate |
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
| admin    | NULL          | fdead603f65d552db24ccc102ab5fdff6d8da12777312a3d | Administrator | admin@bogon | 001436301510664 | 0                |
+----------+---------------+--------------------------------------------------+---------------+-------------+-----------------+------------------+
1 row in set (0.00 sec)

mysql> quit
Bye
root@bogon:~# 

然后再去把之前的

<jdbcProvider>

添加到配置文件:

vi /opt/openfire/conf/openfire.xml 

add jdbcProvider to openfire xml file

再去重启openfire:

root@bogon:~# service openfire restart
Shutting down openfire:                                    [  OK  ]
Starting openfire: 

然后到浏览器中退出openfire:

logout openfire in browser

重新用

admin

admin

登陆openfire,第一次无法登陆。

再去试试,结果还是可以登陆的。

里面是可以看到有admin这个用户的:

can see admin user in openfire

 

【总结】

此处重新安装后,无法使用admin用户去登陆Openfire的原因是:

好像是由于什么bug?

总之是,后来再去重新安装一次Openfire,然后就可以正常用admin去登陆了。

 

另外,更主要的是后来解决掉的这个问题:

【已解决】OpenFire中无法使用自定义数据库中用户去登陆

转载请注明:在路上 » 【已解决】Openfire重新安装后无法用管理员账户admin登陆

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.169 seconds, using 22.23MB memory