SSH@0 - SSH v0 작업

이 작업을 사용하여 SSH를 사용하여 원격 컴퓨터에서 셸 명령 또는 스크립트를 실행합니다. 이 작업을 사용하면 SSH를 사용하여 원격 머신에 연결하고 명령 또는 스크립트를 실행할 수 있습니다.

Syntax

# SSH v0
# Run shell commands or a script on a remote machine using SSH.
- task: SSH@0
  inputs:
    sshEndpoint: # string. Required. SSH service connection. 
    runOptions: 'commands' # 'commands' | 'script' | 'inline'. Required. Run. Default: commands.
    commands: # string. Required when runOptions = commands. Commands. 
    #scriptPath: # string. Required when runOptions = script. Shell script path. 
    #inline: # string. Required when runOptions = inline. Inline Script. 
    #interpreterCommand: '/bin/bash' # string. Optional. Use when runOptions = inline. Interpreter command. Default: /bin/bash.
    #args: # string. Optional. Use when runOptions = script. Arguments. 
  # Advanced
    #failOnStdErr: true # boolean. Fail on STDERR. Default: true.
    #interactiveSession: false # boolean. Enable interactive session. Default: false.
    readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
    #interactiveKeyboardAuthentication: false # boolean. Use interactive-keyboard authentication. Default: false.
# SSH v0
# Run shell commands or a script on a remote machine using SSH.
- task: SSH@0
  inputs:
    sshEndpoint: # string. Required. SSH service connection. 
    runOptions: 'commands' # 'commands' | 'script' | 'inline'. Required. Run. Default: commands.
    commands: # string. Required when runOptions = commands. Commands. 
    #scriptPath: # string. Required when runOptions = script. Shell script path. 
    #inline: # string. Required when runOptions = inline. Inline Script. 
    #interpreterCommand: '/bin/bash' # string. Optional. Use when runOptions = inline. Interpreter command. Default: /bin/bash.
    #args: # string. Optional. Use when runOptions = script. Arguments. 
  # Advanced
    #failOnStdErr: true # boolean. Fail on STDERR. Default: true.
    #interactiveSession: false # boolean. Enable interactive session. Default: false.
    readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
# SSH v0
# Run shell commands or a script on a remote machine using SSH.
- task: SSH@0
  inputs:
    sshEndpoint: # string. Required. SSH service connection. 
    runOptions: 'commands' # 'commands' | 'script' | 'inline'. Required. Run. Default: commands.
    commands: # string. Required when runOptions = commands. Commands. 
    #scriptPath: # string. Required when runOptions = script. Shell script path. 
    #inline: # string. Required when runOptions = inline. Inline Script. 
    #args: # string. Optional. Use when runOptions = script. Arguments. 
  # Advanced
    #failOnStdErr: true # boolean. Fail on STDERR. Default: true.
    readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
# SSH v0
# Run shell commands or a script on a remote machine using SSH.
- task: SSH@0
  inputs:
    sshEndpoint: # string. Required. SSH service connection. 
    runOptions: 'commands' # 'commands' | 'script' | 'inline'. Required. Run. Default: commands.
    commands: # string. Required when runOptions = commands. Commands. 
    #scriptPath: # string. Required when runOptions = script. Shell script path. 
    #inline: # string. Required when runOptions = inline. Inline Script. 
    #args: # string. Optional. Use when runOptions = script. Arguments. 
  # Advanced
    #failOnStdErr: true # boolean. Fail on STDERR. Default: true.

입력

sshEndpoint - SSH 서비스 연결
string. 필수 요소.

원격 머신에 대한 연결 세부 정보가 포함된 SSH 서비스 연결의 이름을 지정합니다. SSH 서비스 연결을 만들려면 원격 머신의 호스트 이름 또는 IP 주소, 포트 번호 및 사용자 이름이 필요합니다.

  • 인증을 위해 프라이빗 키와 암호를 지정해야 합니다.
  • 암호를 사용하여 원격 Linux 머신에 인증할 수 있지만 macOS 또는 Windows 시스템에서는 지원되지 않습니다.

runOptions - 실행
string. 필수 요소. 허용되는 값: commands, script (스크립트 파일), inline (인라인 스크립트). 기본값은 commands입니다.

원격 머신에서 셸 명령 또는 셸 스크립트를 실행합니다.


commands - 명령을
string. 필요한 경우 runOptions = commands입니다.

원격 컴퓨터에서 실행할 셸 명령을 지정합니다. 이 매개 변수는 실행 옵션에 대해 명령을 선택한 경우에만 사용할 수 있습니다. 여러 줄 텍스트 상자의 새 줄에 인수와 함께 각 명령을 입력합니다. 여러 명령을 함께 실행하려면 세미콜론으로 구분된 동일한 줄에 명령을 입력합니다. 예: cd /home/user/myFolder;build.

참고

각 명령은 별도의 프로세스에서 실행됩니다. 상호 종속된 일련의 명령을 실행하려는 경우(예: 명령을 실행하기 전에 현재 폴더 변경) 대신 인라인 스크립트 옵션을 사용합니다.


scriptPath - 셸 스크립트 경로
string. 필요한 경우 runOptions = script입니다.

원격 컴퓨터에서 실행할 셸 스크립트 파일의 경로를 지정합니다. 이 매개 변수는 실행 옵션에 대해 Shell 스크립트를 선택한 경우에만 사용할 수 있습니다.


inline - 인라인 스크립트
string. 필요한 경우 runOptions = inline입니다.

원격 컴퓨터에서 실행할 셸 스크립트를 씁니다.


interpreterCommand - 인터프리터 명령
string. 선택 사항입니다. 를 사용하는 경우 runOptions = inline를 사용합니다. 기본값은 /bin/bash입니다.

스크립트를 실행하는 데 사용되는 명령 인터프리터의 경로를 지정합니다. 스크립트의 시작 부분에 shebang 선을 추가합니다. UNIX와 유사한 운영 체제에만 관련됩니다. Windows 기반 원격 호스트에 빈 문자열을 사용합니다. shebang (#!)에 대해 자세히 알아보세요.


args - 인수
string. 선택 사항입니다. 를 사용하는 경우 runOptions = script를 사용합니다.

셸 스크립트에 전달할 인수를 지정합니다. 이 매개 변수는 실행 옵션에 대해 Shell 스크립트를 선택한 경우에만 사용할 수 있습니다.


failOnStdErr - STDERR에서 실패
boolean. 기본값은 true입니다.

값이 이 true면 원격 명령 또는 스크립트가 에 쓸 STDERR때 빌드가 실패합니다.


interactiveSession - 대화형 세션 사용
boolean. 기본값은 false입니다.

대화형 세션을 시작합니다. 암호 요청은 사용자의 암호로 채워집니다. 대화형 세션은 와 같은 sudo명령을 실행하는 데 유용할 수 있습니다.


readyTimeout - SSH 핸드셰이크 시간 제한
string. 필수 요소. 기본값은 20000입니다.

작업이 SSH 핸드셰이크가 완료되기를 기다리는 시간(밀리초)을 지정합니다.


interactiveKeyboardAuthentication - 대화형 키보드 인증 사용
boolean. 기본값은 false입니다.

대화형 키보드 인증을 사용하도록 설정합니다. true 대상 SSH 서버에 대화형 키보드 인증이 필요한 경우 로 설정합니다(PasswordAuthentication대상 컴퓨터에서 사용하지 않도록 설정됨/sshd_config 아니요로 설정됨).


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성을 참조하세요.

출력 변수

없음

설명

이 작업을 사용하여 SSH를 사용하여 원격 컴퓨터에서 셸 명령 또는 스크립트를 실행합니다. 이 작업을 사용하면 SSH를 사용하여 원격 머신에 연결하고 명령 또는 스크립트를 실행할 수 있습니다.

사전 요구 사항

  • 이 작업은 SSH 키 쌍을 사용하여 원격 머신에 연결할 수 있도록 지원합니다.
  • 공개 키를 미리 설치하거나 원격 머신에 복사해야 합니다.

지원되는 알고리즘

키 쌍 알고리즘

  • RSA
  • DSA

암호화 알고리즘

  • aes256-cbc
  • aes192-cbc
  • aes128-cbc
  • blowfish-cbc
  • 3des-cbc
  • arcfour256
  • arcfour128
  • cast128-cbc
  • arcfour

OpenSSL v1.0.1 이상(에이전트의 경우):

  • aes256-ctr
  • aes192-ctr
  • aes128-ctr

OpenSSL v1.0.1 이상의 경우 NodeJS v0.11.12 이상(에이전트의 경우):

  • aes128-gcm
  • aes128-gcm@openssh.com
  • aes256-gcm
  • aes256-gcm@openssh.com

요구 사항

요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
실행 중 에이전트, DeploymentGroup
요청 없음
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
설정 가능한 변수 모두
에이전트 버전 2.206.1 이상
작업 범주 배포
요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
실행 중 에이전트, DeploymentGroup
요청 없음
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
설정 가능한 변수 모두
에이전트 버전 2.144.0 이상
작업 범주 배포
요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
실행 중 에이전트, DeploymentGroup
요청 없음
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
설정 가능한 변수 모두
에이전트 버전 2.102.0 이상
작업 범주 배포

추가 정보