# SSH 활용하여 원격접속하기 (공통)

{% hint style="info" %} <mark style="color:red;">**SSH(Secure Shell)**</mark> <mark style="color:red;"></mark><mark style="color:red;">란?</mark>\
네트워크를 통해 다른 컴퓨터에 안전하게 접속하기 위한 프로토콜입니다. \
원격 로그인, 원격 명령 실행, 다른 네트워크 서비스의 안전한 터널링 등 다양한 기능을 제공합니다.&#x20;
{% endhint %}

Runyour AI에서는 사용자가 GPU instance에 원격으로 접속하여 다양한 템플릿을 활용할 수 있도록 \
**SSH 접속 기능**을 제공하고 있습니다.

**SSH 원격접속을 활용하면?**

✔️암호화 기술을 통한 데이터 전송 보호

✔️안전한 터널링을 통한 다른 네트워크 서비스 활용 증대

✔️**간단한 입력만으로 VM 환경에서 원격 GPU instance 활용 가능**

**runyourAI가 제공하는&#x20;**<mark style="background-color:yellow;">**템플릿 기능**</mark>**을 통해 Stable Diffusion 을 지금 바로 이용해보세요!**

***

## Step 1. 머신 대여 및 템플릿 선택

<figure><img src="/files/yYKUdM6AcuA7sg0o1SJe" alt=""><figcaption></figcaption></figure>

* GPU Cloud 목록에서 원하는 머신 선택 후, 템플릿 선택 단계로 이동합니다.\
  템플릿을 선택시, SSH 지원 여부를 확인해주세요.
* 대여한 머신은 <mark style="color:blue;">**`[마이페이지] 대시보드`**</mark>에서 확인할 수 있습니다.
* [<mark style="color:blue;">**`WEB`**</mark>](#user-content-fn-1)[^1] 태그가 표시된 템플릿은 별도의 설치 없이 브라우저에서 바로 실행할 수 있습니다.

## Step 2. SSH 원격 접속

<figure><img src="/files/KLABrS6r0UTS2XhwiPrN" alt=""><figcaption></figcaption></figure>

* 대여한 머신 페이지 상단에 **`'SSH 연결 정보'`** 버튼 클릭하세요.

<figure><img src="/files/tSi2JjbJlIVXJU9sAm0W" alt=""><figcaption></figcaption></figure>

* 우선 PEM 키 다운 받으면 아래에 SSH 접속 정보의 코드가 활성화 됩니다. 우측 복사 버튼을 클릭해주세요.&#x20;

```
ssh -i <PEM 키 이름>.pem -p 22 ubuntu@dev-machine.runyour.ai
```

* 위와 같은 형태로 터미널에 코드를 입력해주세요. 그 후 터미널에 SSH 접속이 되었는지 확인해야합니다.

<figure><img src="/files/HodD7z5WHmQj5fFQ8Nok" alt=""><figcaption></figcaption></figure>

<mark style="background-color:red;">만약 이 단계에서 위와 같은 오류가 발생한다면 아래의 문서를 참고해주세요.</mark>

{% content-ref url="/pages/nwOjOSJwGknSpouKcM0I" %}
[Pem 키 파일 권한 변경 해결하기](/userguide/tutorial/pem.md)
{% endcontent-ref %}

<figure><img src="/files/JhIIOGMkUpzlAUcCcTBq" alt=""><figcaption></figcaption></figure>

SSH 접속이 완료되면, 터미널 프롬프트가 ubuntu@머신이름 형태로 바뀌게 됩니다.

이는 현재 로컬 컴퓨터가 아닌, 원격 머신(서버)에 접속한 상태라는 것을 의미합니다.

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://runyourai.gitbook.io/userguide/tutorial/ssh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
