Jenkins User on Apt-Get Install Installation
转自:http://stackoverflow.com/questions/6234016/jenkins-user-on-apt-get-install-installation
QUESTION:
I just installed Jenkins on my Ubuntu server via the debian installation steps (using apt-get install). I want my build to pull from a private git repository on GitHub. With that, I need to use SSH access to get to my repository.
Most of my search results have just said to login as the Jenkins user and generate an SSH key for my GitHub account, but installing through the debian package manager, I don't have a password for the Jenkins user.
So how do I generate an SSH key for my Jenkins server to use?
ANSWER:
I'll anticipate that from time to time you'll want to be able to log in as jenkins to do other tasks, and so I'll solve the more general problem. A strict answer to your question is included at the end.
Change jenkins' password without knowing it
From any account which has sudo permissions, you can reset jenkins' password to something of your choosing:
sudo passwd jenkins
You may be asked first for your own password, in order to use sudo. Then you will be prompted for the new password to set for jenkins, and finally a confirmation of that new password.
If your user with sudo rights is called joe, here's how a session might look:
joe $ sudo passwd jenkins
[sudo] password for joe: **you enter joe's passwd**
Enter new UNIX password: ** you enter new jenkins passwd**
Retype new UNIX password: ** you enter new jenkins passwd**
passwd: password updated successfully
Alternative: login as jenkins without his password
Alternatively, again using sudo from a suitable other account, you can login as jenkins without being asked for his password:
sudo su - jenkins
An aside: Avoiding password prompt confusion
Before issuing sudo passwd jenkins
, we might first like to authenticate separately with sudo to avoid confusion around the question "whose password am I being asked for, now?".
sudo -v
sudo passwd jenkins
After a successful authentication by sudo, there is a window (e.g. 15 minutes) where we won't be prompted to authenticate again. (Note that you can immediately invalidate (kill) this session with sudo -k
, if you want to experiment.)
The promised strict answer
sudo -u jenkins ssh-keygen
Then use cat to view the contents of the public key to be passed to github (but the path is only an example):
sudo cat ~jenkins/.ssh/id_rsa.pub
The exact location and name of the public key file depends on what you entered to the prompts of ssh-keygen, above. I've used a shortcut to jenkins' home dir, ~jenkins
.
Jenkins User on Apt-Get Install Installation的更多相关文章
- 解决ubuntu使用命令sudo apt -get install 安装东西时出现"E: Sub-process /usr/bin/dpkg returned an error code (1) "的错误
问题描述: 今天在使用命令 "sudo apt-get install python3-pip"安装时,总是出现如下图这样的错误,开始以为是以为自己python版本的问题,后来发现 ...
- apt --fix-broken install
1 自动修复安装出现broken的package 但是,如果还是失败的话,就需要手动进行干预了.
- 安装Jenkins到Ubuntu(APT)
运行环境 系统版本:Ubuntu 16.04.4 LTS 软件版本:Jenkins-2.176.2 硬件要求:最低内存:256MB.磁盘:1GB 安装过程 1.配置APT-Jenkins存储库 APT ...
- 用Vagrant创建Jenkins构建环境
这是一个关于Vagrant的学习系列,包含如下文章: Vagrant入门 创建自己的Vagrant box 用Vagrant搭建Jenkins构建环境 用Vagrant和Ansible搭建持续交付平台 ...
- 小团队开发管理工具:gitlab+redmine+testlink+jenkins
由于工作需要,需要为团队搭建一个高效可用的开发管理平台.现在可用的开发管理工具很多开源的.商业的,网上也有很多博客和文章.经过2周的学习比较,再结合自己的项目特点,最后选定工具集:gitlab+red ...
- Linux 搭建 Jenkins
环境准备 安装JDK 安装 JDK 之前写过一篇文章,本文就不具体讲了: Linux 安装 JDK 注意:Java版本不能是gcj,会导致Jenkins有问题,centos7搭建jenkins小记文章 ...
- jenkins的docker
参考:https://store.docker.com/images/jenkins?tab=description https://my.oschina.net/jayqqaa12/blog/633 ...
- 用Ubuntu快速安装Jenkins
一.安装操作系统,安装前准备. 1.操作系统:Ubuntu 18.04 (大家都知道Ubuntu的特点,在线安装,方便很多) 2.apt源.apt源在官网上面分很多种,每个版本的源不一样,如果是其他版 ...
- Installing Jenkins as a Windows service
Install Jenkins as a Windows service NOTE: if you installed Jenkins using the windows installer, you ...
随机推荐
- 3240: [Noi2013]矩阵游戏
Description 婷婷是个喜欢矩阵的小朋友,有一天她想用电脑生成一个巨大的n行m列的矩阵(你不用担心她如何存储).她生成的这个矩阵满足一个神奇的性质:若用F[i][j]来表示矩阵中第i行第j列的 ...
- Ext学习-前后交互模式介绍
在前后台交互模式的介绍中,实际上就是Store中Proxy相关的内容,比如Ajax提交. 所以详细的文档请参考: Ext学习-基础概念,核心思想介绍 中关于数据模型和MVC结构部分. 作者:sdj ...
- js函数:setInterval()/clearInterval()——js网页计时器
一.setInterval()/clearInterval()技术学习 都是window对象的方法,可以直接使用. setInterval(function(){},1000);:每1000毫秒执行一 ...
- NYOJ-44 子串和 AC 分类: NYOJ 2014-01-04 22:53 154人阅读 评论(0) 收藏
作为菜鸟一枚,对子串和的代码完全就是硬算 的..结果是TLE #include<stdio.h> int jh(int x,int y,int num[],int sum[]); int ...
- ajax与jsonp的区别
ajax的核心是通过XmlHttpRequest获取非本页内容,而jsonp的核心则是动态添加<script>标签来调用服务器提供的js脚本.
- HTTP 错误 403.14 - Forbidden
在打开一个网站时,显示HTTP 错误 403.14 - Forbidden 是一件很不幸的事情.我这几天打开某网站就出现了这个问题.Web 服务器被配置为不列出此目录的内容,错误代码0x0000000 ...
- 【ACMER纷纷表示】女生应该找一个玩ACM的男生
1.强烈的事业心 将来,他也一定会有自己热爱的事业.而且,男人最性感的时刻之一,就是他专心致志做事的时候.所以,找一个机会在他全神贯注玩ACM的时候,从侧面好好观察他,你就会发现我说的话没错.2.永不 ...
- Win 7怎样拒绝所有可移动存储设备的所有权限
在Windows 7中,我们可拒绝对任何可移动存储类的权限.下面让我来教大家怎样在组策略中启用“所有可移动存储类:拒绝所有权限”策略,具体操作步骤如下所述: 步骤/方法 在开始搜索框中键入“gpedi ...
- PHP 打印函数之 print print_r
print 说明 int print ( string $arg ) 输出 arg print 实际上不是一个函数(它是一个语言结构),因此你可以不必使用圆括号来括起它的参数列表 参数 arg:输入数 ...
- solr4.5部署
一.服务器部署 1.solr自带jetty服务器上部署 cd到solr-4.5.0\example目录下,运行java -jar start.jar即可运行jetty服务器.访问http://loca ...