Recover Jenkins username and password - windows

how can we reset the username and password in windows for Jenkins.
or is there a way to uninstall Jenkins completely so that when I reinstall it , I can again create a username and password?
Any solutions would be very much appreciated

Option 1
You can simply delete the entire JENKINS_HOME directory and then restart the server. This will prompt you to the new setup wizard.
Option 2
Open JENKINS_HOME/config.xml and disable security by setting the following.
<useSecurity>false</useSecurity>
Then access Jenkins and open the Script Console(JENKINS_URL/script). Execute the following script to create a new user.
import jenkins.model.*
import hudson.security.*
def j = Jenkins.getInstance()
def realm = new HudsonPrivateSecurityRealm(false)
realm.createAccount("newadmin","newpass")
j.setSecurityRealm(realm)
j.save()
Now enable security again and login to Jenkins with the new user.
Additional
If you want to recover the old user. After following the above steps open the file JENKINS_HOME/users/newadmin_RANDOM_NUMBER/config.xml and copy the following two values seed and passwordHash to the old admins config.xml(If the old admins username is admin the file should be located at JENKINS_HOME/users/admin_RANDOM_NUMBER/config.xml)
<jenkins.security.seed.UserSeedProperty>
<seed>405397d771ce33e7</seed>
</jenkins.security.seed.UserSeedProperty>
and
<hudson.security.HudsonPrivateSecurityRealm_-Details>
<passwordHash>#jbcrypt:$2a$10$UGYgHccQxAd9V6neqfJxx.......</passwordHash>
</hudson.security.HudsonPrivateSecurityRealm_-Details>
Then restart the server and you should be able to use the password of newadmin for admin.

Related

Laragon never use mysql password

I try to use Laragon but when i try to create a new Laravel project, Laragon try to create the DB without using a password.
I have this error :
Access denied for user 'root'#'localhost' (using password: NO)
How to define the password to Laragon ?
Ty for your time.
In Laragon's Menu > MySQL, you can:
- Change your root password.
- Reset your root password.
Just go to my.ini and in the first line configure your password.
Just log in to the database and run this command
SET PASSWORD FOR 'root'#'localhost' = PASSWORD('newpassword');
FLUSH PRIVILEGES;
Like so:
Click on the Database button in the Dashboard.
Open the default connection (no password). This will open HeidiSQL.
In the Query tab enter the command above and execute it.
Reconnect.
I already had mySQL all setup on my PC
I went to MySQL -> my.ini this opened the my.ini file in a editor
I then entered mySQL password which I have already had. Saved the file and Laragon used this password successfully
i had the same problem , and none of the above suggestion would work
the only thing i resolved this issue by
Running Laragon as the administrator
and then
In Laragon's Menu > MySQL, you can:
Change your root password.
Press win key + R
write services.msc
Stop MySql
Run laragon from adminstrator.
Menu ---> MySQL---> Change root password

How to login in Jenkins first time? [duplicate]

I tried using Jenkins or my admin username as user and password. For password, I tried to update using sudo passwd jenkins, so I am fine on that. However, I am skeptical about the user name. How do I confirm the username for Jenkins? Can someone pls help me?
During the initial run of Jenkins a security token is generated and printed in the console log. The username is admin
The token should look something like,
*************************************************************
Jenkins initial setup is required. A security token is required to proceed.
Please use the following security token to proceed to installation:
41d2b60b0e4cb5bf2025d33b21cb
*************************************************************
For me the initial admin password was in a log at ~/.jenkins/secrets/initialAdminPassword
after installing with homebrew.
source
If you pod is running in a Kubernetes cluster, just look at the running process … Your initial password will be shown…
e.g.
--argumentsRealm.passwd.admin=**3kJQtPDkhk** --argumentsRealm.roles.admin=admin
Username: admin
For password,
cat /Users/$(whoami)/.jenkins/secrets/initialAdminPassword
you will get similar to this token 2762710d8dab4c88a59fea0a2e559069

Admistration role lost for the default user "weblogic" in oracle webcenter content 12c, not able to login into webcenter console

I have lost the administration role for the default user "weblogic" in Oracle WebCenter content thus not able to login into the WebCenter console and Enterprise management.
screenshot when login with the weblogic user in managed server(/cs). The administration tab got lost.
screenshot when login with the weblogic user in the console and getting error 403 permission denied with the statement:
"User is not authorized to use this feature. To use this feature, you
must have the administrator role. Please LOGIN again."
Please help out as this was strange that the administration access got lost. I can not take much risk with the restart of the server as if it is stopped(by killing the process id, since weblogic is not having admin access now so can't getting stop by normal procedure) it might not start and block people who are working with contributor role.
export MW_HOME=/u01/app/oracle/product/fmw
export DOMAIN_HOME=$MW_HOME/user_projects/domains/prod
export CLASSPATH=$CLASSPATH:$MW_HOME/wlserver_10.3/server/lib/weblogic.jar
. $DOMAIN_HOME/bin/setDomainEnv.sh
cd $DOMAIN_HOME/security/
mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift.old
java weblogic.security.utils.AdminAccount <username> <password> .
cd $DOMAIN_HOME/servers/AdminServer/data/
mv ldap ldap_old
nano $DOMAIN_HOME/servers/AdminServer/security/boot.properties
nohup sh $DOMAIN_HOME/bin/startWebLogic.sh &
https://bitbucket.org/snippets/jhult/ebrGd
http://www.snapdba.com/2010/05/how-to-reset-the-weblogic-admin-server-password/
From your directory (C:\Oracle\Middleware\Oracle_Home_1221\user_projects\domains\gateway_domain1\bin),
run “setDomainEnv.sh” or “setDomainEnv.cmd"
From your security directory inside your domain(C:\Oracle\Middleware\Oracle_Home_1221\user_projects\domains\gateway_domain1\security)
run java weblogic.security.utils.AdminAccount .
From your servers directory (C:\Oracle\Middleware\Oracle_Home_1221\user_projects\domains\gateway_domain1\servers\AdminServer), rename the data folder to something like data_old
similarly inside your security directory, rename boot.properties to boot.properties_old
create a boot.properties file to avoid prompting in weblogic and enter your new username and password there without space or tabs.
username=adminusername
password=adminpassword
now, restart your weblogic and login using new admin creds

How to reset/change expired password for DB2 Content Manager 8.4.1

I had installed IBM DB2 Content Manager 8.4.1 months ago and now I wanted to access it to continue some more work.
But when I try to log in using System Administration Client, it tells me the password is expired. The error is:
DGL0394A: Error in ::DriverManager.getConnection;[jcc][t4][2012][11248][3.50.152]
Connection authorization failure occurred. Reason: Password expired.
ERRORCODE=-4214,SQLSTATE=28000 (STATE) : ;
[SERVER = icmnsldb, USERID = icmadmin, SQL RC = -4214, SQL STATE = 28000]
I've tried looking thru the config files, using the java update command line.. and I can't find a way to change or reset the password. I can't use System Administration Client to change the passwords, since it won't log me in to begin with. Any other method I can use to reset/change the password for a DB2 CM user?
DB2 uses the operating system to authenticate users, so you need to use the OS tools to reset the icmadmin user's password. Your post is tagged as Windows, so look for the icmadmin user in either the local machine or in the domain if your server belongs to a domain.
Just use the Client for Windows on a desktop machine and not the eClient to login. It will directly notify about a expired password and you can set the new password immediately.
I faced the same issue. I logged in as root and chaged the password for db2 user by passwd . and changed in the WAS console. It worked.
In Windows, click on start > Control Panel > User Accounts > User Accounts > Manage User Accounts.
Here, select the DB2 username and click on Reset Password.
If you are on Docker, you need to perform a docker exec into the DB2 container (Linux) and then change the password for the local user that you are trying to log in to DB2 with. In my case, the name of the user was "myuser". I changed the password by executing
passwd myuser
Note that you are root by default when you exec into the container. Else use
docker exec -u root <containerName> /bin/sh

TeamCity forgotten admin password - where to look?

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 months since we used it so now I have forgotten my login - my usual ones don't work.
It is setup without a database at the moment, so was hoping the usernames would just be in a file somewhere, but no luck finding it so far.
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
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
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.
Super user direct URL :
http://servername:port/login.html?super=1
Open TeamCity log folder (Example C: drive: C:\TeamCity\logs) : teamcity-server.log, find the key: “Super user authentication”
[2019-03-04 12:14:30,770] INFO - jetbrains.buildServer.SERVER - Super user authentication token: `8347518935696887114` (use empty username with the token as the password to access the server)
You could try to reset the installation of TeamCity, by removing TeamCity data directory ($/.BuildServer directory by default)
Try the following:
First stop the TeamCity service (would also stop the build agent if installed).
Next open up a console, go to your java directory and run the following command from there:
java.exe -cp server.jar; hsqldb.jar ChangePassword USERNAME PASSWORD "PATH_TO_YOUR_TEAMCITY_INSTALLATION".BuildServer
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.
In case this helps someone else, whoever installed TeamCity on my server placed the build directory under the Administrator's Profile, not in C:\TeamCity.
Specifically for TeamCity running on Tomcat on Windows it will be C:\ProgramData\JetBrains\TeamCity
The directory specified as the last parameter needs to be your Data Directory (find in /logs/teamcity-server.log)
You'll get the 'Table not found' error if you don't have this correct.
You'll get a 'The database is already in use' error if you've got TeamCity running.
you can also search you /logs/teamcity-server.log to see whether you created admin, administrator, or some other admin user name.
For everyone that may arrive at this article years after the original answer like I just did, there's a built-in super user account, and the password is regenerated every time team city is started, and the password is in the log. You can use this super user to login and reset any passwords. It's super easy.
https://confluence.jetbrains.com/display/TCD9/Super+User
TeamCity always uses a database - if you haven't explicitly configured one, it uses a HSQLDB database to store data internally.
When using an external database, user information is stored within that database, so it seems pretty likely that the user information in your case will be stored within the HSQLDB system.
You might be able to gain access to the system by futzing around with the database - but I'd suggest taking a backup first.
Second suggestion - drop the support guys at JetBrains an email. Even before my workplace splashed out on a TeamCity Enterprise license, their support was superb - fast, accurate and helpful.
With TeamCity 5 using MySQL (probably other versions and RDBMs as well, but untested), it's possible to update the password directly via SQL:
mysql> update users set password = md5("mypass123") where username = "bob";
Nevertheless, I'd stick with the CLI versions already mentioned by others if there isn't a good reason not to do so.
First point is if you logout the login screen has the username 'TCAdmin' already filled in, when it should be 'administrator'. TCAdmin is the full name of (I think) the default version 5 admin user. Changing that to administrator and then using the password I thought it was solved my issue.
For resetting...
In case it helps someone else on Windows XP on version 5 of TeamCity, my .BuildServer config info was also under my current logged in user's documents and settings folder. Also I was tripped up by a space in the list of jar files in Sebastien's good answer above.
So I changed to this directory in a command prompt:
c:\teamcity\webapps\ROOT\WEB-INF\lib
and then this command line (to set password: Password1) worked for me:
C:\TeamCity\webapps\ROOT\WEB-INF\lib>..\..\..\..\jre\bin\java.exe -cp server.jar;commonapi.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword administrator Password1
Which gave output:
Using TeamCity configuration directory path: C:/Documents and Settings/tamw/.BuildServer
Password changed successfuly
Stop teamcity
You should pass path to your buildserver
e.g. if you installed build server to dir "c:\.BuildServer"
........\jre\bin\java.exe -cp server.jar;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword username newpassword c:\.BuildServer
To change user password:
Shutdown server
Switch to the /webapps/ROOT/WEB-INF/lib directory
Invoke the following command:
Windows platform:
java -cp server.jar;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword
Unix platform:
java -cp server.jar:common-api.jar:commons-codec-1.3.jar:util.jar:hsqldb.jar ChangePassword
You can skip the option, if you are using default path for TeamCity data files: /.BuildServer
[Ref: http://confluence.jetbrains.com/display/TCD7/Changing+user+password+with+default+authentication+scheme]
Here's what worked for me.
Shut down server services
> cd c:\TeamCity\webapps\ROOT\WEB-INF\lib>
then
> ..\..\..\..\jre\bin\java.exe -cp server.jar ;common-api.jar;commons-codec-1.3.jar;util.jar;hsqldb.jar ChangePassword admin password1 C:\ProgramData\JetBrains\TeamCity\
Without the path at the end, it would fail with:
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.ja
va:1833)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(jdbcConnection.java:5
80)
at ChangePassword.main(ChangePassword.java:14)
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";
Alternatively, You could use the TeamCity Server Log and retrieve the Super User token.
Using the token, go to the URL : http://(server):(port)/login.html?super=1
ie: http://localhost:92/login.html?super=1
Once you logged in, you could always create a new user or reset the password for the account in question.
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

Resources