# Connect to your machine

Source: https://bflops.com/docs/connect

Open a terminal on the machine over SSH, copy files to and from it, and keep jobs running.



Every machine is reached over SSH. Its rental page shows the command once it is **Running**. Find your machines on [Rentals](/rentals).

## Open a terminal on it [#open-a-terminal-on-it]

1. Open the rental from [Rentals](/rentals).
2. Under **Reach it**, copy the SSH command.
3. Run it on your computer:

```bash title="On your computer"
ssh -p 40022 root@203.0.113.7
```

The first time, SSH asks whether to trust the machine. Type `yes`. You are now `root` on the machine. Check the GPUs:

```bash title="On the machine"
nvidia-smi
```

## Copy files [#copy-files]

Use `scp` with the same port and address. The port flag is a capital `-P` for `scp`.

```bash title="Your computer to the machine"
scp -P 40022 ./train.py root@203.0.113.7:/root/
```

```bash title="The machine to your computer"
scp -P 40022 root@203.0.113.7:/root/model.pt ./
```

For a folder, add `-r`. For large or many files, `rsync` resumes where it stopped:

```bash title="On your computer"
rsync -avP -e "ssh -p 40022" ./data/ root@203.0.113.7:/root/data/
```

## Keep a job running after you disconnect [#keep-a-job-running-after-you-disconnect]

Closing your terminal stops what runs in it. Start long jobs inside `tmux`:

```bash title="On the machine"
tmux new -s train
python train.py
```

Press Ctrl+B, then D, to leave it running. Reconnect later and return with `tmux attach -t train`.

## Only port 22 [#only-port-22]

A machine takes SSH and nothing else from the internet. Reach anything else it serves, such as Jupyter or your own web app, through an [SSH tunnel](/docs/apps#open-an-app-in-your-browser).

## What you cannot do [#what-you-cannot-do]

* Run Docker. A machine is already a container.
* Reach it on any port but SSH.

## Next [#next]

[Open an app in your browser](/docs/apps)
