inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

Jenkins를 이용한 CI/CD Pipeline 구축

Ansible에서 Kubernetes 제어하기

Ansible 서버에서 Windows 호스트 접속 문제

1141

나무돌이

작성한 질문수 1

0

윈도우 환경이고, 도커데스크탑을 이용해서 강의 진행중입니다.

Ansible에서 Kubernetes 제어하기 강의 내용에서 문제가 생겨서 문의글 남깁니다.

Ansible-Server에서 ssh keygen 생성 후 ssh-copy-id 윈도우계정@윈도우호스트IP 입력.

윈도우 호스트의 C드라이브/Users/윈도우계정/.ssh 하위에 authorized_keys에 Ansible-Server의 공개키를 복사해 두었습니다.

ssh 윈도우계정@윈도우아이피로 접속시에 계속해서 패스워드를 묻는 창이 뜨는데요, 해결 방법이 있는지 궁금합니다.

ssh -v 윈도우계정@윈도우아이피 입력시 출력창

 

OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf

debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config

debug1: configuration requests final Match pass

debug1: re-parsing configuration

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf

debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config

debug1: Connecting to 192.168.0.33 [192.168.0.33] port 22.

debug1: Connection established.

debug1: identity file /root/.ssh/id_rsa type 0

debug1: identity file /root/.ssh/id_rsa-cert type -1

debug1: identity file /root/.ssh/id_dsa type -1

debug1: identity file /root/.ssh/id_dsa-cert type -1

debug1: identity file /root/.ssh/id_ecdsa type -1

debug1: identity file /root/.ssh/id_ecdsa-cert type -1

debug1: identity file /root/.ssh/id_ed25519 type -1

debug1: identity file /root/.ssh/id_ed25519-cert type -1

debug1: identity file /root/.ssh/id_xmss type -1

debug1: identity file /root/.ssh/id_xmss-cert type -1

debug1: Local version string SSH-2.0-OpenSSH_8.0

debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.1

debug1: match: OpenSSH_for_Windows_8.1 pat OpenSSH* compat 0x04000000

debug1: Authenticating to 192.168.0.33:22 as '82102'

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: algorithm: curve25519-sha256

debug1: kex: host key algorithm: ecdsa-sha2-nistp256

debug1: kex: server->client cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none

debug1: kex: client->server cipher: aes256-gcm@openssh.com MAC: <implicit> compression: none

debug1: kex: curve25519-sha256 need=32 dh_need=32

debug1: kex: curve25519-sha256 need=32 dh_need=32

debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

debug1: Server host key: ecdsa-sha2-nistp256 SHA256:aeCMaeYYVSVWrcf7SWUB7C2RRkMH3SMT0wFDi0Gl8Og

debug1: Host '192.168.0.33' is known and matches the ECDSA host key.

debug1: Found key in /root/.ssh/known_hosts:1

debug1: rekey out after 4294967296 blocks

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: rekey in after 4294967296 blocks

debug1: Will attempt key: /root/.ssh/id_rsa RSA SHA256:P0l3EmzgWKERm6r85A/GZ1shIV61KgQqSsADDKxLOLI

debug1: Will attempt key: /root/.ssh/id_dsa

debug1: Will attempt key: /root/.ssh/id_ecdsa

debug1: Will attempt key: /root/.ssh/id_ed25519

debug1: Will attempt key: /root/.ssh/id_xmss

debug1: SSH2_MSG_EXT_INFO received

debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: publickey

debug1: Offering public key: /root/.ssh/id_rsa RSA SHA256:P0l3EmzgWKERm6r85A/GZ1shIV61KgQqSsADDKxLOLI

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Trying private key: /root/.ssh/id_dsa

debug1: Trying private key: /root/.ssh/id_ecdsa

debug1: Trying private key: /root/.ssh/id_ed25519

debug1: Trying private key: /root/.ssh/id_xmss

debug1: Next authentication method: keyboard-interactive

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: password

82102@192.168.0.33's password:

 

jenkins kubernetes ansible cicd sonarqube

답변 1

0

Dowon Lee

안녕하세요, 이도원입니다.

Windows에서 SSH 서버를 활성화 하기 위해 Windows에 Openssh 서버를 설치하셔야 합니다. 올려주신 메시지를 봤을 때는 이미지 OpenSSH 서버는 설치되어 있는 것 같습니다만, 혹시 설치 전이라고 하시면 아래와 같은 명령어를 실행하여 설치하시고 방화벽 설정도 확인해 보시기 바랍니다. 아래 명령어는 관리자모드 Powershell에서 실행하시기 바랍니다.

  • OpenSSH 서버 설치

    • Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

  • OpenSSH 서버 실행

    • Start-Service sshd

  • 방화벽 설정 확인

    • Get-NetFirewallRule -Name OpenSSH-Server-In-TCP

 

다음은 마지막 방화벽 설정 확인 시 표시 되는 이미지 입니다. Enabled 속성이 True로 표시되면 사용하실 수 있는 상태입니다.

image

다음 작업을 진행하시기 전에 먼저, Windows 콘솔(CMD나 Powershell)에서 ssh client로 지금 설치한 OpenSSH Server에 접속되는지 확인해 보도록 합니다.

image

위 이미지에서 제 Windows 계정은 zitan이고 Windows Host IP는 192.168.0.11 입니다. Password는 Windows 계정의 암호를 입력하셔야 하는데, 이부분에서 PIN 번호를 사용하여 로그인 중이시라면, PIN 번호가 아닌 정확한 암호를 입력하셔야 하니 주의 하시기 바랍니다.

위 과정을 모두 실행 다음에는, anisble-server 컨테이너에서 ssh-keygen으로 키를 생성 후 ssh-copy-id 하셨을 때, 정상적으로 Widnows .ssh 폴더에 키 파일이 복사될 겁니다.

감사합니다.

0

Dowon Lee

추가로, 아래 게시글에서 ansible 설정도 참고하시기 바랍니다.

https://www.inflearn.com/questions/686434

감사합니다.

git 에 강의내용에 필요한 파일들 존재하지 않음

0

84

2

젠킨스에 등록된..

0

98

2

yml 파일 db 접속정보 수정 후 배포 시 미반영

0

108

2

jdk 버전 17

0

81

2

섹션2 강의자료

0

103

2

DOCKER 이미지 PULL

0

266

1

36강 edowon0623/cicd-project-ansible이 호환이 안되는것 같아요

0

63

1

질문이 있습니다!!

0

68

1

exec /usr/local/tomcat/bin/catalina.sh: invalid argument 오류 해별법(공유)

1

203

4

m2 mac: ansible-server에서 container 실행 안됨

0

159

2

Jenkins와 k8s 연동과 관련한 질문입니다.

0

97

2

Ansible 과 연동에서 이미지 및 컨테이너 생성과 관련한 질문 드립니다.

0

176

2

맥북 실리콘칩 invalid argument 에러 해결 (수동 설치)

0

255

3

Docker Container에서 Tomcat 설치

0

221

2

ec2 여러대에서 각각 직접 설치 이유

0

154

1

P@ssw0rd 설정시기

0

147

2

ansible 원리

0

135

2

ansible 존재여부

0

116

2

젠킨스 빌드 성공후 shutdown

0

249

2

Docker Hub에 Push 무한 로딩

0

120

2

컨테이너에 ssh로 접속 비밀번호 불일치

0

117

1

maven project 오류

0

118

2

엔서블을 이용하여 톰캣 이미지 배포 후, 되돌리는 방법

0

150

2

쿠버네티스 이용시, api gateway 와 service discovery 역할

0

270

2