在Mac上更改'jenkins'默认用户(user_name) [英] Change the 'jenkins' default USER (user_name) on mac

查看:584
本文介绍了在Mac上更改'jenkins'默认用户(user_name)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我们的Mac服务器上安装了Jenkins. 但是,在配置页面上,它设置了user.name = jenkins和USER = jenkins 如何将Mac服务器上的'jenkins'默认用户(user_name)更改为其他内容?

I just installed Jenkins on our mac server. However, looking at the configuration page, it set user.name=jenkins and USER=jenkins How do I change the 'jenkins' default USER (user_name) on the mac server to something else?

我们非常感谢您的帮助 谢谢

Any help is really appreciated Thanks

推荐答案

答案取决于您如何安装Jenkins,但我将假定您使用Mac的官方Jenkins安装程序.

The answer depends on how did you install Jenkins, but I will assume you used the official Jenkins installer for Mac.

您可以从启动守护程序中看到配置文件,用户名是硬编码的.您将必须更改文件,该文件已安装到系统中的/Library/LaunchDaemons/org.jenkins-ci.plist

As you can see from the launch daemon config file, the username is hard-coded. You will have to change the file, which is installed into your system at /Library/LaunchDaemons/org.jenkins-ci.plist

首先,通过运行launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

将用户名"从"jenkins"更改为要用于运行Jenkins的用户.

Change the UserName from "jenkins" to the user you want to use to run Jenkins.

您还需要更改JENKINS_HOME以指向您的首选用户具有写许可权的目录. (或将/Users/Shared/Jenkins/Home更改为您的首选用户拥有.)

You will need to also change JENKINS_HOME to point to a directory where your preferred user has write permission. (Or change /Users/Shared/Jenkins/Home to be owned by your preferred user.)

然后通过运行launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist

下次使用Mac安装程序进行升级时,所做的更改将被覆盖,因此您必须重新进行一次操作.停止使用Mac安装程序,然后下载新的jenkins.war文件并手动替换它可能更安全.

The next time you upgrade using the Mac installer, your changes will be overwritten, so you will have to do it all over again. It might be safer to stop using the Mac installer and just download the new jenkins.war file and replace it manually.

这篇关于在Mac上更改'jenkins'默认用户(user_name)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆