Install Jenkins on windows with service account - jenkins

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.

Related

jenkins installation windows 10 "Service Logon Credentials"

I don't know Jenkins at all. I want to install Jenkins on Windows 10. I downloaded the installer and ran it, but I have a problem. I don't know what to enter in the "Account" and "Password" fields on the "Service Logon Credentials" stage.
if I use the username and password of my Windows account(with administrator privileges) the following information is displayed:
When installing a service to run under a domain user account, the account must have the right to logon as a service. This logon permission applies strictly to the local computer and must be granted in the Local Security Policy.
Perform the following to edit the Local Security Policy of the computer you want to define the ‘logon as a service’ permission:
Logon to the computer with administrative privileges.
Open the ‘Administrative Tools’ and open the ‘Local Security Policy’
Expand ‘Local Policy’ and click on ‘User Rights Assignment’
In the right pane, right-click ‘Log on as a service’ and select properties.
Click on the ‘Add User or Group…’ button to add the new user.
In the ‘Select Users or Groups’ dialogue, find the user you wish to enter and click ‘OK’
Click ‘OK’ in the ‘Log on as a service Properties’ to save changes.
Then try again with the added user.
(Source)
Below solution worked for me on Windows10.
Select Logon Type = Run Service as Local System ,click Install and complete the setup
To unlock Jenkins, Go to C:\Program Files\Jenkins and open jenkins.err
Get Administrator password ,paste and Install suggested plugins.
Create first admin user and start using Jenkins
Follow Chanaka Karunarathne's answer, just in the 'enter the object name to select' section enter your PC's user name. If you do not know what is your user name then just open a command prompt and run 'whoami'.
I followed this procedure to install Jenkins and it worked like a charm,
https://www.youtube.com/watch?v=1_Zs0gQq1Yc
Step1:
Download the "jenkins.war" file.
Step 2:
Run this command java -jar jenkins.war
Step 3:
Copy the secret that you get from this location,
C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword
Use this Key when prompted to "Unlock Jenkins",
If you are a windows 10 home user, you need to download and install GPEdit.msc in Windows 10 Home using PowerShell script before you can use "Local Security Policy". you can download it from here.
I was be able to follow https://stackoverflow.com/users/4309588/chanaka-karunarathne's suggestion, but when it went to the next step, I tried to enter my "admin"(aka laptop login credentials), in my case I usually login with the 4-digit code to my Windows; and even if I use the password associated with the account, it would be my email as username and it's windows password as password, but I have setup two-step authentication for my email as well. it would not work.
I ended up username + 4 digit pass-code would not work on this
username(email address) + password would not work as well (due to the MFA)
I don't know why it had to be this difficult to login to Jenkins (or not sure if I should be upset about myself for setting up MFA for my email :) )
#elysium You can solve such problem by switching from Microsoft Account to Local Account for your computer. On assuming that your computer is similar to mine, you can navigate as follows;
Press/Click the Microsoft Windows tab on your keyboard.
Navigate to your profile picture and click on "Change Account Settings"
Navigate to Log in with Local Account instead and make the switch from Microsoft Account to Local Account.
Follow #Chanaka Karunarathne 's instructions. If you cannot find Local Security Policy, Go to search and type winver to confirm if you are using either of this OS versions ; Windows 10 Pro, Windows 10 Education, Windows 10 Pro Edu, Windows 10 Enterprise, Windows 10 Pro Workstation) otherwise Windows 10 Home lucks Local Security Policy, atleast for my case.
Alternatively, as mentioned in some previous comments here, to enable Group policy in Windows 10 Home, download a from here, right click on it run as administrator. Press Window Key + R, type gpedit.msc to check if Group policy has been enabled as described in this majorgeeks youtube channel (https://www.youtube.com/watch?v=7wkgwEhtqdI&ab_channel=majorgeeks)
In Windows 11, I am getting the same error even though provided user and password are correct. So I have installed Jenkins as LocalSystem.
After completion of installation, I changed it from the services and it worked for me.

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.

login issue with hudson server after moving to new hardware

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.

Which account should a TFS Build Agent service run under?

Background information
I need our TFS build agents to run under a specific account so that our ClickOnce certificates are authorised.
However if I run under the account X, which also is the user account of the build controller that has the correct certificates. I get the error: "Source is already in use". Even if I restart the service and/or the virtual machine.
Originally rightly/wrongly our build agents were running under the Network Service account, however this account cannot verify the certificates.
Using the Local System account does not give access to the build controller from a developer box.
So I guess my question is: What account should the service 'Visual Studio Team Foundation Build Service Host' run under?
It turned out that the account X was the correct choice (our build controller user account, that has few privileges).
It was that the account needed adding to the builders group TFS Admin.
My personal suggestion would be: a specifically-created, minimum-privelige account that is only authorised as far as is necessary to build the code on your build machines, and no more.
I'm not aware of any restriction around the user for the build agent vs the build controller, though - in fact I'm sure I've used a similar setup before. Is it possible that your error is misleading? Changing users might be a workaround, but perhaps there's something else fixable going on.

When I install TFS 2010 what is the standard user name and password at /tfs?

I just installed TFS 2010. When I go to machine-name:8080/tfs on my web browser it asks for a user name and password. What is the standard user name and password? How do I set this?
It should accept all username/password combinations which are valid on the machine running TFS.
There is no default password thing. (could be that default installation only allows administrative login)
See MSDN for further information on configuring TFS 2010:
http://msdn.microsoft.com/en-us/library/ms252477.aspx
In My case it was all about firewall configuration, let me tell you what I was dealing with:
I checked out windows firewall and I saw that there was an exception for TFS But it was not enough, why? See following image:
As you can see, TFS has been excepted but not for Public
So you can tick the check box for Public or you can change your network location from Public to Home or Work, go to: Control Panel > Network and Sharing Center
Change Your network Location
Now you can simply use those Windows accounts you have and it will be accepted definitely.
Overview: What was default Username and Password again?
Assumption: You are using TFS in local network, Your own server your own client!
Short answer: As a simplest method, you should create a windows account, introduce it in TFS to grant permissions, then you can login by that account from wherever in your local network.
Long Answer:
Step1: Create one or more windows account(s), to do that, go to control panel -> User accounts -> manage another account (Create another account while you can use the account you already have) -> Create a new account ->Give it a name
Probably you may need to select administrator
Then select created account -> Create a password
Step 2:
Go to Web Portal for VS TFS 2015, click on team members (or click on the gear icon in the above bar, and go to security tab) Add -> Add windows user or group -> Browse for account you already created or simply type it to add it.
Step 3:
Go to web portal for Visual Studio Team Foundation Server 2015, through web browser by some address like http://user-pc:8080/tfs (which you can find it in your VS or TFS) just like
then you encounter a dialog box which asks you for username and password, give the credential it asks based on windows account you have created, if everything is OK and no problem with firewall it's done.
Finally:
You might see multiple users in windows welcome screen which seems annoying, to prevent windows from showing them in the welcome screen
Go to Computer -> Manage -> Local Users and Groups -> Users
double click on each one of them and remove their member of data (which is set to Users by default)
Thanks to THIS
There is none. Log in as admin on the machine. Then create a new project group etc. Define admins there (Domain integrated). Their usernames / paswords will work then.

Resources