다음을 통해 공유


Azure Arc 지원 서버에 대한 SSH 액세스 문제 해결

이 문서에서는 SSH를 통해 Arc 지원 서버에 연결을 시도하는 동안 발생할 수 있는 문제를 해결하는 방법에 대한 정보를 제공합니다. 일반적인 내용은 Arc 지원 서버에 대한 SSH 액세스 개요를 참조하세요.

클라이언트 쪽 문제

이러한 문제는 사용자가 연결하는 컴퓨터에서 발생하는 오류로 인해 발생합니다.

클라이언트 이진 파일을 찾을 수 없음

이 문제는 연결하는 데 필요한 클라이언트 쪽 SSH 이진 파일을 찾을 수 없는 경우에 발생합니다. 가능한 오류:

  • Failed to create ssh key file with error: \<ERROR\>.
  • Failed to run ssh command with error: \<ERROR\>.
  • Failed to get certificate info with error: \<ERROR\>.
  • Failed to create ssh key file with error: [WinError 2] The system cannot find the file specified.
  • Failed to create ssh key file with error: [Errno 2] No such file or directory: 'ssh-keygen'.

해결 방법:

  • --ssh-client-folder 매개 변수를 사용하여 SSH 클라이언트 실행 파일이 포함된 폴더의 경로를 제공합니다.
  • 폴더가 Azure PowerShell의 PATH 환경 변수에 있는지 확인합니다.

Azure PowerShell 모듈 버전 불일치

이 문제는 설치된 Azure PowerShell 하위 모듈인 Az.Ssh.ArcProxy가 설치된 Az.Ssh 버전에서 지원되지 않는 경우에 발생합니다. 오류:

  • This version of Az.Ssh only supports version 1.x.x of the Az.Ssh.ArcProxy PowerShell Module. The Az.Ssh.ArcProxy module {ModulePath} version is {ModuleVersion}, and it is not supported by this version of the Az.Ssh module. Check that this version of Az.Ssh is the latest available.

해결 방법:

  • Az.Ssh 및 Az.Ssh.ArcProxy 모듈 업데이트

Az.Ssh.ArcProxy가 설치되지 않음

이 문제는 클라이언트 컴퓨터에서 프록시 모듈을 찾을 수 없는 경우에 발생합니다. 오류:

  • Failed to find the PowerShell module Az.Ssh.ArcProxy installed in this machine. You must have the Az.Ssh.Proxy PowerShell module installed in the client machine in order to connect to Azure Arc resources. You can find the module in the PowerShell Gallery (see: https://aka.ms/PowerShellGallery-Az.Ssh.ArcProxy).

해결 방법:

사용자에게 프록시를 실행할 권한이 없습니다.

이 문제는 사용자에게 연결하는 데 사용되는 SSH 프록시를 실행할 수 있는 권한이 없는 경우에 발생합니다. Errors:

  • /bin/bash: line 1: exec: /usr/local/share/powershell/Modules/Az.Ssh.ArcProxy/1.0.0/sshProxy_linux_amd64_1.3.022941: cannot execute: Permission denied
  • CreateProcessW failed error:5 posix_spawnp: Input/output error

해결 방법:

  • 사용자에게 프록시 파일을 실행할 수 있는 권한이 있는지 확인합니다.

서버 쪽 문제

공개 미리 보기 후에는 연결할 수 없음

사용자가 공개 미리 보기에 참여하고 Arc 에이전트 및 Azure CLI/PowerShell을 일반 공급 릴리스로 업데이트한 경우 연결이 실패할 수 있습니다.

해결 방법:

서버에서 SSH 트래픽이 허용되지 않음

이 문제는 SSHD가 서버에서 실행되고 있지 않거나 서버에서 SSH 트래픽이 허용되지 않는 경우에 발생합니다. 오류:

  • {"level":"fatal","msg":"sshproxy: error copying information from the connection: read tcp 192.168.1.180:60887-\u003e40.122.115.96:443: wsarecv: An existing connection was forcibly closed by the remote host.","time":"2022-02-24T13:50:40-05:00"}
  • {"level":"fatal","msg":"sshproxy: error connecting to the address: 503 connection to localhost:22 failed: dial tcp [::1]:22: connectex: No connection could be made because the target machine actively refused it.. websocket: bad handshake","proxyVersion":"1.3.022941"}
  • SSH connection is not enabled in the target port {Port}.

해결 방법:

  • SSHD 서비스가 Arc 지원 서버에서 실행 중인지 확인합니다.
  • 포트 22(또는 기본이 아닌 기타 포트)의 Arc 지원 서버에서 기능이 사용하도록 설정되어 있는지 확인합니다.

az rest --method put --uri https://management.azure.com/subscriptions/<subscription>/resourceGroups/<resourcegroup>/providers/Microsoft.HybridCompute/machines/<arc enabled server name>/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH?api-version=2023-03-15 --body '{\"properties\": {\"serviceName\": \"SSH\", \"port\": \"22\"}}'

Azure 사용 권한 문제

SSH 연결을 사용하도록 설정하는 역할 할당이 잘못됨

이 문제는 현재 사용자에게 대상 리소스에 기여할 수 있는 적절한 역할 할당이 없는 경우에 발생합니다. 오류:

  • Client is not authorized to create a Default connectivity endpoint for {Name} in the Resource Group {ResourceGroupName}. This is a one-time operation that must be performed by an account with Owner or Contributor role to allow connections to target resource

해결 방법:

  • 리소스에 대한 소유자 또는 기여자 역할이 있는지 확인하거나 리소스의 소유자/기여자에게 문의하여 SSH 연결을 설정합니다.

연결할 역할 할당이 잘못됨

이 문제는 현재 사용자에게 대상 리소스에 대한 적절한 역할 할당이 없는 경우, 특히 read 권한이 없는 경우에 발생합니다. 가능한 오류:

  • Unable to determine the target machine type as Azure VM or Arc Server
  • Unable to determine that the target machine is an Arc Server
  • Unable to determine that the target machine is an Azure VM
  • Permission denied (publickey).
  • Request for Azure Relay Information Failed: (AuthorizationFailed) The client '\<user name\>' with object id '\<ID\>' does not have authorization to perform action 'Microsoft.HybridConnectivity/endpoints/listCredentials/action' over scope '/subscriptions/\<Subscription ID\>/resourceGroups/\<Resource Group\>/providers/Microsoft.HybridCompute/machines/\<Machine Name\>/providers/Microsoft.HybridConnectivity/endpoints/default' or the scope is invalid. If access was recently granted, please refresh your credentials.

해결 방법:

  • 연결하려는 리소스에 대한 Virtual Machine 로컬 사용자 로그인 역할이 있는지 확인합니다. Microsoft Entra 로그인을 사용하는 경우 Virtual Machine 사용자 로그인 또는 Virtual Machine 관리자 로그인 역할이 있고 Arc 지원 서버에 Microsoft Entra SSH 로그인 확장이 설치되어 있는지 확인합니다.

HybridConnectivity RP가 등록되지 않음

이 문제는 HybridConnectivity 리소스 공급자가 구독에 등록되지 않은 경우에 발생합니다. 오류:

  • Azure Relay 정보 요청 실패: (NoRegisteredProviderFound) 코드: NoRegisteredProviderFound

해결 방법:

  • az provider register -n Microsoft.HybridConnectivity을 실행합니다.
  • az provider show -n Microsoft.HybridConnectivity를 실행하여 성공을 확인하고 registrationStateRegistered로 설정되었는지 확인합니다.
  • Arc 지원 서버에서 하이브리드 에이전트 다시 시작

CLI 도구 및 Arc 에이전트를 업데이트한 후 연결할 수 없음

이 문제는 Arc 에이전트가 업데이트되기 전에 업데이트된 명령이 새 서비스 구성을 만들 때 발생합니다. 이는 버전 1.31 이상으로 업데이트하는 경우 1.31 이전의 Azure Arc 버전에만 영향을 미칩니다. 오류:

  • UNKNOWN 포트 65535로 인해 연결 닫힘

    해결 방법:

    • 기존 서비스 구성을 삭제하고 다음 연결 시 CLI 명령에 의해 다시 만들 수 있도록 허용합니다. az rest --method delete --uri https://management.azure.com/subscriptions/<SUB_ID>/resourceGroups/<RG_NAME>/providers/Microsoft.HybridCompute/machines/<VM_NAME>/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH?api-version=2023-03-15을 실행합니다.

Azure Arc 지원 서버에 대한 SSH 사용 안 함

이 기능은 다음 작업을 완료하여 사용하지 않도록 설정할 수 있습니다.

  • Arc 지원 서버에서 SSH 포트 및 기능 제거: az rest --method delete --uri https://management.azure.com/subscriptions/<subscription>/resourceGroups/<resourcegroup>/providers/Microsoft.HybridCompute/machines/<arc enabled server name>/providers/Microsoft.HybridConnectivity/endpoints/default/serviceconfigurations/SSH?api-version=2023-03-15 --body '{\"properties\": {\"serviceName\": \"SSH\", \"port\": \"22\"}}'

  • 기본 연결 엔드포인트(az rest --method delete --uri https://management.azure.com/subscriptions/<subscription>/resourceGroups/<resourcegroup>/providers/Microsoft.HybridCompute/machines/<arc enabled server name>/providers/Microsoft.HybridConnectivity/endpoints/default?api-version=2023-03-15)를 만듭니다.

다음 단계