# How to Connect

After renting a GPU server on Clore.ai, you can connect via SSH or access pre-installed services like Jupyter Notebook.

## Connection Information

Once your order is active, you'll find connection details in:

1. **My Orders** page → Click on your active order
2. **Order details** will show: IP address, SSH port, and credentials

## SSH Connection

### Linux / macOS

Open Terminal and run:

```bash
ssh root@<IP_ADDRESS> -p <PORT>
```

Example:

```bash
ssh root@185.123.45.67 -p 22022
```

### Windows

**Using PowerShell:**

```powershell
ssh root@<IP_ADDRESS> -p <PORT>
```

**Using PuTTY:**

1. Download [PuTTY](https://putty.org)
2. Enter the IP address in "Host Name"
3. Enter the port number in "Port"
4. Click "Open"
5. Login as `root` with the provided password

## SSH Keys (Recommended)

For passwordless login, add your SSH public key:

1. Go to **Account** → **SSH Keys**
2. Click **Add Key**
3. Paste your public key (usually `~/.ssh/id_rsa.pub`)
4. Save

Your key will be automatically deployed to new rentals.

### Generate SSH Key (if you don't have one)

```bash
ssh-keygen -t rsa -b 4096
```

## Jupyter Notebook Access

Many images come with Jupyter pre-installed:

1. Check your order details for the Jupyter URL
2. Open the URL in your browser (usually `http://<IP>:<JUPYTER_PORT>`)
3. Enter the token shown in your order details

## File Transfer

### Using SCP

Upload file to server:

```bash
scp -P <PORT> /local/file.txt root@<IP>:/remote/path/
```

Download file from server:

```bash
scp -P <PORT> root@<IP>:/remote/file.txt /local/path/
```

### Using rsync

For larger transfers or syncing directories:

```bash
rsync -avz -e "ssh -p <PORT>" /local/folder/ root@<IP>:/remote/folder/
```

## Port Forwarding

To access services running on the server locally:

```bash
ssh -L 8080:localhost:8080 root@<IP> -p <PORT>
```

This forwards server port 8080 to your local port 8080.

## Common Issues

| Issue              | Solution                                                                  |
| ------------------ | ------------------------------------------------------------------------- |
| Connection refused | Check if the server is fully booted (wait 2-3 minutes after order starts) |
| Permission denied  | Verify password/SSH key is correct                                        |
| Connection timeout | Check if the port is correct                                              |
| Host key changed   | Remove old key: `ssh-keygen -R [<IP>]:<PORT>`                             |

## Useful Commands After Connecting

Check GPU status:

```bash
nvidia-smi
```

Check available disk space:

```bash
df -h
```

Check system resources:

```bash
htop
```
