jenkins
다음을 수행하여 로그인을 허용하도록 jenkins CI 서버 설치로 생성 된 비 로그인 사용자를 변환했습니다 .
그런 다음 공개 개인 키 쌍을 만들었습니다.
이제 컴퓨터에서 루트로서 su - jenkins
젠킨스 사용자가 될 수 있습니다 . 그러나 원격 컴퓨터에서는이 컴퓨터에 대한 공개 키로 ssh 할 수 없습니다 (해당 키가있는 jenkins 사용자로).
useradd를 통해 컴퓨터에 새 사용자를 만들고이 계정에 jenkins ssh 키를 복사하고 키를 사용하여이 사용자로 로그인 할 수있었습니다.
ssh 공개 키 액세스를 차단할 수있는 jenkins 사용자의 특별한 점에 완전히 당황했습니다. 내 마음에 떠오르는 유일한 것은 jenkins 사용자가 사용자 ID 498로 생성되었다는 것입니다. 'system'사용자가 ssh를 허용하지 못하도록 차단하는 것이 있습니까?
-v
사용자 jenkins로 로그인 실패에 대해 활성화 된 ssh 명령의 끝은 다음과 같습니다.
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
사용자 foo로 성공적인 로그인 (동일한 키 사용) :
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Trying private key: id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to jenkins.internal.nara.me ([54.83.203.146]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
이 중에서 뭔가 누락되었을 가능성이 있습니다.
이것을 디버깅하려면 sshd를 다시로드하십시오.
LogLevel VERBOSE
/ etc / ssh / sshd_config에서
이 키가 허용되지 않는 이유에 대한 정보는 /var/log/auth.log (또는 이에 상응하는 centos)를 참조하십시오. 상세 모드에서 sshd는 항상 이유를 말합니다.)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다