login issue with hudson server after moving to new hardware - jenkins

I am using hudson 3.3.3 and have just moved my hudson server to a new server and after movement. But i am not able to login to new hudson server. When i give my login credentials, hudson logs shows me successful login:
hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:125)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:34)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:736)
at hudson.model.Build$RunnerImpl.build(Build.java:181)
at hudson.model.Build$RunnerImpl.doRun(Build.java:136)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:524)
at hudson.model.Run.run(Run.java:1495)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:82)
at hudson.model.Executor.run(Executor.java:137)
Apr 12, 2018 5:19:02 PM hudson.security.AuthenticationProcessingFilter2 successfulAuthentication
INFO: Login attempt successful for user
But the screen still shows login option on top right and not getting "Manage Hudson" option. I added anonymous user as admin in hudson-security.xml file and after restart i am able to see "Manage Hudson" option without login. So admin access is open for each user at this time. How can i solve this as security risk is too high with everyone having admin access :(

I assume that you have moved all needed plugins, secrets folder and users folder from your old server. I assume that you have used the initial admin password to unlock the new Jenkins server.
I suspect that after you login, there could be redirect, please double check the URL before and after the login.
There could be DNS issue. If the Jenkins URL is the same for the new and the old server try to login by IP.
Double check configurations, for example if you are using nginx as reverse proxy.

Related

Install Jenkins on windows with service account

I am trying to install Jenkins on Windows 10. When I run the windows installer, it asks for a user account. Which account is that? I create an account in Jenkins but when I do test connection, it says "User name and/or password incorrect".
Can someone please help me here?
Thanks!
If you are on Windows 10 what you can do is:
use the window search bar to search for Local Security Policy and open it.
Click on Local Policies
Click on User Rights Assignment
By the right side showing the policies, open Logon as a service
Click on Add User or Group button.
In the input part written enter the object name, input the account name you created that you want to change to a service account.
Once you have inputed it, click on Check Name to verify.
finally click ok and you are good to go, you can now use the account while installing Jenkins.
Based on your question, following is what I am guessing,
If you are installing Jenkins from an installer and it asks for windows username/password, then your login might need higher privilege(Administrator) rights to install further.
If the installation is successful, then initial username is "admin" and password could be located at,
$JENKINS_HOME/secrets/initialAdminPassword
cat /var/lib/jenkins/secrets/initialAdminPassword
Check these links - ubuntu, windows
I suppose you got the error when you tried to install Jenkins and selected Logon Type Run as service as local or domain user.
If so, I ran into the same problem. I solved it by creating a new user on windows.
Type Add, edit or remove other users and double klick it
In the new dialog under Other users select Add someone else to this PC
Click on I don't have this person's sign-in information
Click on Add a user without a Microsoft account
Enter username and password
Enter the new credentials into Jenkins installer dialog
Refer to my anwser to a similar question. It is asking for a Windows account with "Log on as a service" permission. This is the account Jenkins app will run under.
These steps helped for me:
Download the latest Jenkins war from https://www.jenkins.io/download/
Keep it program files folder (e.g. C:\Program Files (x86)\Jenkins)
Start Jenkins (java -jar jenkins.war)
Check console.
Now stop this Jenkins instance (Cntrl +C)
In "Services", find the Jenkins and set the credentials one more time in the "Logon" tab. Save changes.
Now start the old instance through service, it should start normally and old jobs should appear at the console.

Hudson doesn't keep users signed in. How to fix this?

Our team has a hudson instance. Multiple users use it. However, even though a user checks the 'Keep me signed in' checkbox on the sign-in ("Welcome to Jenkins") page, it still asks at every new launch of that link.
I am the admin of the hudson server. Is there a way I can disable this so that the users who use the hudson instance aren't inconvenienced with logging in everytime once they have selected the 'Keep me signed in' checkbox on the sign-in page?
When we migrated our Jenkins server, users started complaining about a similar issue. It turned out that the default session timeout was low (30 minutes).
You can check your default timeout:
import org.kohsuke.stapler.Stapler;
Stapler.getCurrentRequest().getSession().getMaxInactiveInterval() / 60
Change the timeout (steps for Ubuntu).
Edit the file /etc/default/jenkins with the settings below and reboot the machine.
2.1. Add variable session timeout (in minutes).
SESSION_TIMEOUT=660
2.2. The new variable should be included in JENKINS_ARGS:
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --httpListenAddress=$HTTP_HOST --sessionTimeout=$SESSION_TIMEOUT"
You can see also:
Increase the Jenkins login timeout

Unable to Authenticate my Bitbucket server account with Sourcetree / How to register in source tree with Bitbucket Server credentials

I have a Bitbucket repository, which I'm able to logging in web browser with my credentials, Now I want to checkout it in Sourcetree, So I've installed Sourcetree 2.6.10, It requires authentication to Bitbucket server with Root URL & Username to continue, I'm providing input in below format...
Root URL : https://bitbucket.xxxxxxx.com
Username : xxxxxx.xxxxxx
The error i'm getting is...
Failed to check login for user [xxxxx.xxxxxx]. You do not have permission to access URL ‘https://bitbucket.xxxxxxxxx.com/rest/api/1.0/users/xxxxxx.xxxxxx’ please check the user credentials associated with this account. The request returned with status code ‘Unauthorized’.
Any help would be appreciated, thanks !
To fix:
1-go to source tree window, clicked remote
2-little gear icon, clicked "settings"
3-double clicked on Bitbucket server, changed protocol from default HTTPS to SSH
To Perforce, Now, I m sharing another solution whether if the user prefers, BitBucket Cloud intergrated with SourceTree,(facing the above stated issue),
Since one of the steps of the upgrade process was to input your Atlassian account password, you should now have a password set (in addition to being able to use Google). You should be able to use your Bitbucket username and Atlassian account password to authenticate SourceTree.
If you need to reset your Atlassian account password, you can do so here: https://id.atlassian.com/login/resetpassword
Source : https://community.atlassian.com/t5/Bitbucket-questions/Cannot-login-with-Bitbucket-in-SourceTree-after-linking-with/qaq-p/145231
I had a similar problem trying to register Sourcetree the first time I opened it, using my company's Bitbucket Server URL. Turns out I just needed to include https:// at the beginning of the URL.
Drop everything after ".com" and log in there.
e.g. log into
https://bitbucket.xxxxxxx.com
not
‘https://bitbucket.xxxxxxxxx.com/rest/api/1.0/users/xxxxxx.xxxxxx’
see also
https://jira.atlassian.com/browse/SRCTREEWIN-8743

Connecting to Team Foundation Server with a pc with no AD

So we currently have a TFS 2015 server on premise installation.
All users are registered using Active Directory account.
PC connecting to the web portal that are using AD accounts are automatically logged in since it detects the current logged in user.
My problem is we have devices that are not in AD. E.G. personal laptops that sometimes view the portal to check work items and such.
You can type in your uname and password to log in but the problem is TFS keeps asking for the uname and password every 2 minutes or so making it tedious to do anything.
Do you have any solution to this problem?
On Windows, you simply add the user and password to the Credential Manager (Control Panel\All Control Panel Items\Credential Manager) in the Windows Credential tab.
Make sure you use a recent version of Git for Windows which includes the proper Git credential manager.

How to enable Auto Logon for Google Chrome without prompt

We need to access the intranet site called as "http://mysite/myapp".
And with using IE, every domain users can access the site without any prompt.
But, if the user try it with Chrome, the logon prompt shows at first. After entering credential just once, the prompt doesn't appear anymore for the access.
I'm just wondering any way to avoid the first-time logon prompt on Chrome.
And we don't want any chrome browser setting or shortcut for white listing per user. Because we can't handle many users Chrome one by one.
Any help will be appreciated.
Thanks.
Check the details of the Integration Authentication in this Chromium documentation:
http://www.chromium.org/developers/design-documents/http-authentication
With Integrated Authentication, Chrome can authenticate the user to an
Intranet server or proxy without prompting the user for a username or
password. It does this by using cached credentials which are
established when the user initially logs in to the machine that the
Chrome browser is running on. Integrated Authentication is supported
for Negotiate and NTLM challenges only.
Basically, execute Chrome with these switches to specify the auth schemes:
Chrome.exe --auth-server-whitelist="MYIISSERVER.DOMAIN.COM" --auth-negotiate-delegatewhitelist="MYIISSERVER.DOMAIN.COM" --auth-schemes="digest,ntlm,negotiate"
I tried running the command line but it wasn't working. I had to configure the same settings via the Windows Registry:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
"AuthSchemes"="basic,digest,ntlm,negotiate"
"AuthServerWhitelist"="*domain"
"AuthNegotiateDelegateWhitelist"="domain,server.domain.com"
Then I Killed Chrome (cmd line: TaskKill /im chrome.exe) and restarted chrome and tried again and voila. Everything worked as expected.

Resources