部署使用:https://www.imooc.com/article/30338
1. 修改Jenkins配置文件
 1.1 修改$JENKINS_USER
 打开jenkins配置文件:
➜ vim /etc/sysconfig/jenkins
 1
 找到如下行:
将原来的jenkins用户修改为 root用户。
$JENKINS_USER="www"
 1.2 修改Jenkins相关文件夹用户权限
 更改jenkins三个文件夹的用户所有都和用户组:
➜ chown -R www:www /var/lib/jenkins
 ➜ chown -R www:www /var/cache/jenkins
 ➜ chown -R www:www /var/log/jenkins
 1.3 重启Jenkins
 重启Jenkins服务并检查运行Jenkins的用户是否已经切换为root。
➜ systemctl restart jenkins
 1.4 查看Jenkins进程所属用户
 ➜ ps -ef | grep jenkins
 若显示为www用户,则表示修改完成。
  
jenkins检出项目报错:Permissions 0755 for '/home/lonecloud/.ssh/id_rsa' are too open.
1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0755 for '/home/lonecloud/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/lonecloud/.ssh/id_rsa": bad permissions
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
问题解决:
chmod -R 700 ~/.ssh/










