Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins CLI : ERROR: anonymous is missing the Overall/Read permission

I'm stuck with this problem and I have no idea to solve it.

I have written a Shell script which will invoke my job using Jenkins CLI by passing my private key.Jenkins version is 2.121.1

java -jar jenkins-cli.jar -s http://localhost:8080 -i ~/.ssh/id_rsa build RTT/RTT-CI-Tools/RTT-CI-Tools-Distribute -s -p SLAVE_REGEX=testserver

Getting Error message as :

ERROR: anonymous is missing the Overall/Read permission

The same script works in another Jenkins (2.7.4). How to fix this issue.

like image 671
user2439278 Avatar asked Dec 02 '22 11:12

user2439278


2 Answers

You can also use auth param but you should to type your password in console

java -jar jenkins-cli.jar -s http://localhost:8080/ -auth myLoggin:myPassword list-jobs
like image 81
younes nedjar Avatar answered Dec 04 '22 23:12

younes nedjar


Please check for below points

1) USER exist on jenkins server as same on linux machine.

2) SSH Public key shared on Jenkins server is correct.(manage jenkins --> manage user --> click on ${USER} --> click on configure --> then check ssh public key is correct).

3) CMD i used(working) --> java -jar jenkins-cli.jar -ssh -user ${USER} -i ~/.ssh/id_rsa -s http://localhost:8080/jenkins/ build ${JOB_NAME}

please check if you are executing cmd from same user.

4) SSH port should be enable on Jenkins (go to manage Jenkins--> configure Global security --> SSH Server... set SSHD Port Fixed eg 38844)

like image 42
Rohit Jindal Avatar answered Dec 04 '22 23:12

Rohit Jindal