Windows服务是否需要管理员权限

Windows服务是否需要管理员权限

本文介绍了Jenkins Windows服务是否需要管理员权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于安全原因,我们认为最好让Jenkins Windows服务以没有管理员权限的用户身份运行.但是,这会导致Jenkins服务器启动时出错:

For security reasons we thought it would be better if the Jenkins windows service would run as user without admin rights. However, this leads to an error on Jenkins server startup:

java.io.IOException: Access is denied   at
java.io.WinNTFileSystem.createFileExclusively(Native Method)    at
java.io.File.createTempFile(Unknown Source)     at
hudson.util.AtomicFileWriter.<init>(AtomicFileWriter.java:142)

Caused:
    java.io.IOException: Failed to create a temporary file in C:\Program Files (x86)\Jenkins

该用户(Windows 7,Active Directory用户)具有Jenkins文件夹的所有权限(特殊权限"除外,该权限无法选择).

The user (Windows 7, Active Directory user) has all rights on the Jenkins folder (excluding 'Special rights', which cannot be chosen).

是否可以/以非管理员用户身份运行Jenkins Windows服务(服务器以及其他计算机上的从服务器)?

Is it possible/reasonable to run the Jenkins windows service (server as well as slaves on other computers) as non-admin user?

推荐答案

我建议将Jenkins安装在辅助分区中,例如G:\Jenkins.

I would suggest installing Jenkins in a secondary partition, like G:\Jenkins.

即使您没有辅助分区,C:\Jenkins也要优于C:\Program Files\JenkinsC:\Program Files(x86)\Jenkins,以避免不必要地妨碍操作系统.

Even if you don't have a secondary partition C:\Jenkins is better than C:\Program Files\Jenkins or C:\Program Files(x86)\Jenkins to avoid the operating system unnecessarily getting in the way.

有了这个设置,我总是将Jenkins服务设置为以用户身份运行(最好是一个具有未过期密码的服务帐户),该用户是盒子上Administrators组的成员.

With that in place I always set the Jenkins service to run as a user (preferable a service account with a non-expiring password) that is a member of the Administrators group on the box.

这样做通常可以避免许多不必要的烦人的权限问题,这些问题只会妨碍您的进度并减慢您的进度.

Doing this usually avoids many of the unnecessary annoying permissions issues that only get in the way and slow your progress.

应该注意的是,当涉及Windows批处理步骤时,Jenkins不会以管理员身份运行(至少自2007年以来我就一直没有使用Jenkins).

It should be noted that when it comes to Windows Batch Steps Jenkins will not Run As Administrator (at least it hasn't in the years since 2007 I have been using Jenkins).

这篇关于Jenkins Windows服务是否需要管理员权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 12:02