Nexus3.19版本密碼重置

參考地址:https://support.sonatype.com/hc/en-us/articles/213467158-How-to-reset-a-forgotten-admin-password-in-Nexus-3-x

1.停止服務

    # ./nexus stop
        Shutting down nexus

2.進入OrientDB控制檯(OrientDB是不一開源NoSql數據庫)

    #cd ../nexus-3.19.1-01/lib/support

    # ls
    nexus-orient-console.jar
    加載jar包
    #java -jar ./lib/support/nexus-orient-console.jar
    提示錯誤:Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/orient/console/Main : **Unsupported major.minor version 52.0**

    查看JAVA版本是否過低
    # java -version
        java version "1.7.0_80"
        Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
        Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

        解決方法:安裝JAVA1.8以上版本
        orientdb> 
            連接數據庫格式:connect <url> <user> [<password>]
            WHERE:
                * url               The url of the remote server or the database to connect to in the format '<mode>:<path>'
                * user              User name
                * password          User password (optional)

3 進入數據庫

orientdb> connect plocal:../sonatype-work/nexus3/db/security admin admin

Connecting to database [plocal:/home/cqs/data/nexus/sonatype-work/nexus3/db/security] with user 'admin'...
2020-03-17 18:21:19:075 WARNI Not enough physical memory available for DISKCACHE: 1,490MB (heap=361MB direct=361MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now running with DISKCACHE=256MB [OMemoryAndLocalPaginatedEnginesInitializer]OK

orientdb {db=security}

查看用戶名是否存在admin

 > > select * from user where id = "admin"

+----+-----+------+-----+------+--------+-----------+---------------+---------------------------------------------------------------------------------------------------+
|#   |@RID |@CLASS|id   |status|lastName|firstName  |email          |password                                                                                           |
+----+-----+------+-----+------+--------+-----------+---------------+---------------------------------------------------------------------------------------------------+
|0   |#15:0|user  |admin|active|User    |Administ...|admin@exampl...|$shiro1$SHA-512$1024$ksGQUj3R+CuvzLNvrTWm5A==$OJSYDLBq47rESaV+NJ3hMCc/D+j/UEdW9gD1fpo15nJ5mAwyHw...|
+----+-----+------+-----+------+--------+-----------+---------------+---------------------------------------------------------------------------------------------------+

1 item(s) found. Query executed in 0.008 sec(s).
orientdb {db=security}>

4 重置密碼

    將admin用戶密碼重置爲admin123,具體執行如下:
    #update user SET password="$shiro1$SHA-512$1024$NE+wqQq/TmjZMvfI7ENh/g==$V4yPw8T64UQ6GfJfxYq2hLsVrBY8D1v+bktfOxGdt4b/9BthpWPNUy/CBk6V9iA0nHpzYzJFWO8v/tZFtES8CA==" UPSERT WHERE id="admin"

5 啓動服務

# ./nexus start
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章