TeamCity forgotten admin password - where to look?

后端 未结 19 1089
情书的邮戳
情书的邮戳 2020-12-23 11:19

I need to recover/reset the admin password for JetBrain\'s TeamCity.

I have full RDP access to the server so no problems there. It\'s just been 2 mo

相关标签:
19条回答
  • 2020-12-23 11:41

    I've just had to go through this pain with v5 EAP.

    I managed to reset the password successfully by running:

    C:\TeamCity\webapps\ROOT\WEB-INF\lib>..\..\..\..\jre\bin\java -cp server.jar;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword admin password c:\TeamCity\.BuildServer
    

    Although you'll need to substitute C:\TeamCity with wherever your installation is located.

    0 讨论(0)
  • 2020-12-23 11:42

    We are using Teamcity 7 with MS SQL Server as the RDBMS.

    To reset your password you can use the following query:

    UPDATE users SET password = LOWER(SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('md5','your_new_password')),3,32))
     where username = "your_user_name";
    
    0 讨论(0)
  • 2020-12-23 11:43

    In case none of those works, see http://sebastienlachance.com/post/Resetting-TeamCity-Password.aspx.

    Open a command prompt and go to \webapps\ROOT\WEB-INF\lib folder. Now type the following :

    ..\..\..\..\jre\bin\java.exe -cp server.jar;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword username newpassword
    
    0 讨论(0)
  • 2020-12-23 11:43

    For TeamCity 6.5.4

    From a command prompt in the [TeamCity install folder]\webapps\ROOT\WEB-INF\lib:

    ..\..\..\..\jre\bin\java -cp server.jar;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword admin NewPassword
    

    My username was 'admin' in my case (I think I set it during installation but I can't be sure).

    I ommitted the path to TeamCity argument, it's smart enough to use the correct path (mine was c:\users\administrator.BuildServer)

    When I provided the (wrong) path to TeamCity as an argument I received this message:

    Using TeamCity configuration directory path: c:/TeamCity/.BuildServer
    Exception in thread "main" java.sql.SQLException: Table not found in statement [UPDATE users SET PASSWORD = ? WHERE USERNAME = ? AND REALM IS NULL]
        at org.hsqldb.jdbc.Util.throwError(Util.java:58)
        at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(jdbcPreparedStatement.java:1833)
        at org.hsqldb.jdbc.jdbcConnection.prepareStatement(jdbcConnection.java:580)
        at ChangePassword.main(ChangePassword.java:14)
    

    In case this confuses other people too.

    0 讨论(0)
  • 2020-12-23 11:47

    I passed in the same situation and did login with super user, follow steps below:

    1 - Get Token in the "teamcity-server.log" in the path "XX:\TeamCity\logs";

    2 - Access and login using token at url: "/login.html?super=1";

    More about it:

    https://confluence.jetbrains.com/display/TCD18/Super+User

    0 讨论(0)
  • 2020-12-23 11:49

    From TeamCity 8 you can log in as a super user and change the password that way. You just need to use an empty username and last occurrence of the "super user authentication token" found in the logs\teamcity-server.log file as your password.

    Please see the following for more information:

    • TeamCity 8 - http://confluence.jetbrains.com/display/TCD8/Super+User
    • TeamCity 9 - http://confluence.jetbrains.com/display/TCD9/Super+User
    • TeamCity 10 - https://confluence.jetbrains.com/display/TCD10/Super+User
    0 讨论(0)
提交回复
热议问题