{"action":"created","comment":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/147224363","pull_request_review_id":72290386,"id":147224363,"diff_hunk":"@@ -345,3 +345,48 @@ java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, Server, X-Co\n         at hudson.cli.CLI.<init>(CLI.java:132)\n         ... 3 more\n ----\n+\n+====== Server key did not validate\n+In the case the Jenkins CLI client show you a stacktrace that looks like:\n+[source]\n+----\n+org.apache.sshd.common.SshException: Server key did not validate\n+    at org.apache.sshd.client.session.AbstractClientSession.checkKeys(AbstractClientSession.java:523)\n+    at org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:616)\n+    ...\n+----\n+and you can find a log entry just below concerning like `mismatched keys`. \n+It means your SSH configuration does not recognize the public key presented by the server. It's often the case when you run Jenkins in dev mode and multiple instances\n+of the application are run under the same SSH port over time.\n+\n+In a development context, you can just access your `~/.ssh/known_hosts` (or in `C:/Users/<your_name>/.ssh/known_hosts` for Windows)\n+and remove the line corresponding to your current SSH port, example : `[localhost]:3485`.\n+In a production context, check with the Jenkins administrator if the public key of the server changed recently.\n+If it's the case, just do like for development but otherwise inform the administrator the keys seem to have be changed.\n+\n+====== UsernameNotFoundException\n+\n+If your client displays a stacktrace that looks like:\n+[source]\n+----\n+org.acegisecurity.userdetails.UsernameNotFoundException: <name_you_used>\n+    ...\n+----\n+That means your SSH keys were recognized and valid against the users stored but the username is not valid against the SecurityRealm your application is using at the moment.\n+This could occurs when you were using the Jenkins database initially, configured your users and switch to another SecurityRealm (like LDAP, etc.) where the defined users do not exist yet.\n+\n+To solve the problem, ensure your users exist in your configured SecurityRealm.\n+\n+====== Troubleshooting logs\n+\n+To have more information about the authentication process, follow those steps:\n+\n+. Go in *Manage Jenkins* > *System Log* > *Add new log recorder*.\n+. Enter any name you want (e.g. AuthConsole) and click on *Ok*.\n+. Then click on *Add*, type `org.jenkinsci.main.modules.sshd.PublicKeyAuthenticatorImpl` (tips: you can just type `PublicKeyAuth` and select the full name), let the level to *ALL*.\n+. Repeat the previous step for `hudson.model.User`\n+. Click on *Save*\n+\n+When you try to authenticate, you can then refresh the page and see what happen internally.\n+\n+Additional tip: you can click on *ENABLE AUTO REFRESH* to have a continuous logging page.","path":"content/doc/book/managing/cli.adoc","position":48,"original_position":48,"commit_id":"c8d7a1a56d693df64539deafb192aefabd784692","original_commit_id":"c8d7a1a56d693df64539deafb192aefabd784692","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars1.githubusercontent.com/u/154109?v=4","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"Better not recommend this—it will turn on auto refresh for other pages, too.\r\n\r\nIf we need live updates to logger pages we will implement that directly.","created_at":"2017-10-26T18:14:19Z","updated_at":"2017-10-26T18:14:25Z","html_url":"https://github.com/jenkins-infra/jenkins.io/pull/1202#discussion_r147224363","pull_request_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/147224363"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/1202#discussion_r147224363"},"pull_request":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202"}}},"pull_request":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202","id":148934378,"html_url":"https://github.com/jenkins-infra/jenkins.io/pull/1202","diff_url":"https://github.com/jenkins-infra/jenkins.io/pull/1202.diff","patch_url":"https://github.com/jenkins-infra/jenkins.io/pull/1202.patch","issue_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/1202","number":1202,"state":"open","locked":false,"title":"[JENKINS-27026] Add paragraphs about the CLI authentication","user":{"login":"Wadeck","id":2662497,"avatar_url":"https://avatars1.githubusercontent.com/u/2662497?v=4","gravatar_id":"","url":"https://api.github.com/users/Wadeck","html_url":"https://github.com/Wadeck","followers_url":"https://api.github.com/users/Wadeck/followers","following_url":"https://api.github.com/users/Wadeck/following{/other_user}","gists_url":"https://api.github.com/users/Wadeck/gists{/gist_id}","starred_url":"https://api.github.com/users/Wadeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wadeck/subscriptions","organizations_url":"https://api.github.com/users/Wadeck/orgs","repos_url":"https://api.github.com/users/Wadeck/repos","events_url":"https://api.github.com/users/Wadeck/events{/privacy}","received_events_url":"https://api.github.com/users/Wadeck/received_events","type":"User","site_admin":false},"body":"In order to document a bit the new authentication part in the CLI, three new troubleshooting cases were added.\r\n\r\nSee [JENKINS-27026](https://issues.jenkins-ci.org/browse/JENKINS-27026).\r\n\r\n### Desired reviewers\r\n\r\n@reviewbybees @jglick \r\n\r\n\r\n### Screenshot\r\n![doc_update_cli_auth](https://user-images.githubusercontent.com/2662497/32055038-ce20aa76-ba60-11e7-90b1-5cb55d0573a0.png)\r\n","created_at":"2017-10-26T13:27:24Z","updated_at":"2017-10-26T18:14:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b11ca7fcc1082f42773bafdb8d574a529053d846","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202/commits","review_comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202/comments","review_comment_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/1202/comments","statuses_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/c8d7a1a56d693df64539deafb192aefabd784692","head":{"label":"Wadeck:JENKINS-27026_CLI_AUTHENTICATION","ref":"JENKINS-27026_CLI_AUTHENTICATION","sha":"c8d7a1a56d693df64539deafb192aefabd784692","user":{"login":"Wadeck","id":2662497,"avatar_url":"https://avatars1.githubusercontent.com/u/2662497?v=4","gravatar_id":"","url":"https://api.github.com/users/Wadeck","html_url":"https://github.com/Wadeck","followers_url":"https://api.github.com/users/Wadeck/followers","following_url":"https://api.github.com/users/Wadeck/following{/other_user}","gists_url":"https://api.github.com/users/Wadeck/gists{/gist_id}","starred_url":"https://api.github.com/users/Wadeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wadeck/subscriptions","organizations_url":"https://api.github.com/users/Wadeck/orgs","repos_url":"https://api.github.com/users/Wadeck/repos","events_url":"https://api.github.com/users/Wadeck/events{/privacy}","received_events_url":"https://api.github.com/users/Wadeck/received_events","type":"User","site_admin":false},"repo":{"id":107249474,"name":"jenkins.io","full_name":"Wadeck/jenkins.io","owner":{"login":"Wadeck","id":2662497,"avatar_url":"https://avatars1.githubusercontent.com/u/2662497?v=4","gravatar_id":"","url":"https://api.github.com/users/Wadeck","html_url":"https://github.com/Wadeck","followers_url":"https://api.github.com/users/Wadeck/followers","following_url":"https://api.github.com/users/Wadeck/following{/other_user}","gists_url":"https://api.github.com/users/Wadeck/gists{/gist_id}","starred_url":"https://api.github.com/users/Wadeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wadeck/subscriptions","organizations_url":"https://api.github.com/users/Wadeck/orgs","repos_url":"https://api.github.com/users/Wadeck/repos","events_url":"https://api.github.com/users/Wadeck/events{/privacy}","received_events_url":"https://api.github.com/users/Wadeck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Wadeck/jenkins.io","description":"A static site for the Jenkins automation server","fork":true,"url":"https://api.github.com/repos/Wadeck/jenkins.io","forks_url":"https://api.github.com/repos/Wadeck/jenkins.io/forks","keys_url":"https://api.github.com/repos/Wadeck/jenkins.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wadeck/jenkins.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wadeck/jenkins.io/teams","hooks_url":"https://api.github.com/repos/Wadeck/jenkins.io/hooks","issue_events_url":"https://api.github.com/repos/Wadeck/jenkins.io/issues/events{/number}","events_url":"https://api.github.com/repos/Wadeck/jenkins.io/events","assignees_url":"https://api.github.com/repos/Wadeck/jenkins.io/assignees{/user}","branches_url":"https://api.github.com/repos/Wadeck/jenkins.io/branches{/branch}","tags_url":"https://api.github.com/repos/Wadeck/jenkins.io/tags","blobs_url":"https://api.github.com/repos/Wadeck/jenkins.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wadeck/jenkins.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wadeck/jenkins.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wadeck/jenkins.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wadeck/jenkins.io/statuses/{sha}","languages_url":"https://api.github.com/repos/Wadeck/jenkins.io/languages","stargazers_url":"https://api.github.com/repos/Wadeck/jenkins.io/stargazers","contributors_url":"https://api.github.com/repos/Wadeck/jenkins.io/contributors","subscribers_url":"https://api.github.com/repos/Wadeck/jenkins.io/subscribers","subscription_url":"https://api.github.com/repos/Wadeck/jenkins.io/subscription","commits_url":"https://api.github.com/repos/Wadeck/jenkins.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wadeck/jenkins.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wadeck/jenkins.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wadeck/jenkins.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wadeck/jenkins.io/contents/{+path}","compare_url":"https://api.github.com/repos/Wadeck/jenkins.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wadeck/jenkins.io/merges","archive_url":"https://api.github.com/repos/Wadeck/jenkins.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wadeck/jenkins.io/downloads","issues_url":"https://api.github.com/repos/Wadeck/jenkins.io/issues{/number}","pulls_url":"https://api.github.com/repos/Wadeck/jenkins.io/pulls{/number}","milestones_url":"https://api.github.com/repos/Wadeck/jenkins.io/milestones{/number}","notifications_url":"https://api.github.com/repos/Wadeck/jenkins.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wadeck/jenkins.io/labels{/name}","releases_url":"https://api.github.com/repos/Wadeck/jenkins.io/releases{/id}","deployments_url":"https://api.github.com/repos/Wadeck/jenkins.io/deployments","created_at":"2017-10-17T09:50:49Z","updated_at":"2017-10-17T09:50:55Z","pushed_at":"2017-10-26T13:26:41Z","git_url":"git://github.com/Wadeck/jenkins.io.git","ssh_url":"git@github.com:Wadeck/jenkins.io.git","clone_url":"https://github.com/Wadeck/jenkins.io.git","svn_url":"https://github.com/Wadeck/jenkins.io","homepage":"https://jenkins.io","size":148834,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkins-infra:master","ref":"master","sha":"a1f33ceff2d029810b3ea65e1622d78a0d73bd5d","user":{"login":"jenkins-infra","id":7422698,"avatar_url":"https://avatars2.githubusercontent.com/u/7422698?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkins-infra","html_url":"https://github.com/jenkins-infra","followers_url":"https://api.github.com/users/jenkins-infra/followers","following_url":"https://api.github.com/users/jenkins-infra/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-infra/subscriptions","organizations_url":"https://api.github.com/users/jenkins-infra/orgs","repos_url":"https://api.github.com/users/jenkins-infra/repos","events_url":"https://api.github.com/users/jenkins-infra/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":44886691,"name":"jenkins.io","full_name":"jenkins-infra/jenkins.io","owner":{"login":"jenkins-infra","id":7422698,"avatar_url":"https://avatars2.githubusercontent.com/u/7422698?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkins-infra","html_url":"https://github.com/jenkins-infra","followers_url":"https://api.github.com/users/jenkins-infra/followers","following_url":"https://api.github.com/users/jenkins-infra/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-infra/subscriptions","organizations_url":"https://api.github.com/users/jenkins-infra/orgs","repos_url":"https://api.github.com/users/jenkins-infra/repos","events_url":"https://api.github.com/users/jenkins-infra/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkins-infra/jenkins.io","description":"A static site for the Jenkins automation server","fork":false,"url":"https://api.github.com/repos/jenkins-infra/jenkins.io","forks_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/forks","keys_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/teams","hooks_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/hooks","issue_events_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/events{/number}","events_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/events","assignees_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/assignees{/user}","branches_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/branches{/branch}","tags_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/tags","blobs_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/languages","stargazers_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/stargazers","contributors_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/contributors","subscribers_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/subscribers","subscription_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/subscription","commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/contents/{+path}","compare_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/merges","archive_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/downloads","issues_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues{/number}","pulls_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/labels{/name}","releases_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/releases{/id}","deployments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/deployments","created_at":"2015-10-24T22:02:57Z","updated_at":"2017-10-09T14:27:16Z","pushed_at":"2017-10-26T13:27:25Z","git_url":"git://github.com/jenkins-infra/jenkins.io.git","ssh_url":"git@github.com:jenkins-infra/jenkins.io.git","clone_url":"https://github.com/jenkins-infra/jenkins.io.git","svn_url":"https://github.com/jenkins-infra/jenkins.io","homepage":"https://jenkins.io","size":148473,"stargazers_count":67,"watchers_count":67,"language":"HTML","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":259,"mirror_url":null,"archived":false,"open_issues_count":12,"forks":259,"open_issues":12,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/1202"},"issue":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/1202"},"comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/1202/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/1202/commits"},"statuses":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/c8d7a1a56d693df64539deafb192aefabd784692"}},"author_association":"NONE"}}
{"actor":{"display_login":"jglick"}}