# Connecting

## Your SSH key

Your VPS Ultra running Linux opens with your **SSH key**: a pair of files created on your computer. The **public** part is installed on the server; the **private** part stays on your computer and is shared with no one, our team included.

On macOS, Linux and Windows 10 or 11 (PowerShell or the Terminal):

```
ssh-keygen -t ed25519
```

Accept the suggested location and choose a passphrase. Your public key is the `id_ed25519.pub` file: a line that starts with `ssh-ed25519`. Send it to our team when you order: we install it on your server when we prepare it.

## Connecting over SSH

Your server's card, **VPS** section of your client area, shows the **SSH connection** command:

```
ssh root@203.0.113.20
```

Your server has its own IPv4 address: the connection uses the usual SSH port, 22, or the one you choose in `/etc/ssh/sshd_config`. Once your domain points to your server, its name works too: `ssh root@app.my-company.com`.

### A shortcut: the \~/.ssh/config file

```
Host myultra

    HostName 203.0.113.20

    User root

    IdentityFile ~/.ssh/id_ed25519
```

Then `ssh myultra` is enough, and the same shortcut works for `scp`, `rsync`, `git` and your editor.

## Adding or replacing a key

Your server's keys are in `/root/.ssh/authorized_keys`, one per line, and you manage them yourself:

* **add a colleague**: paste their public key on a new line of the file, or create their own account for them (`adduser`) with their key in `/home/<their account>/.ssh/authorized_keys`;
* **remove an access**: delete their line;
* **change computer**: add your new public key before removing the old one.

Your private key has gone and no key opens the server for you any more? Send your new public key to support: our team installs it on your server.

## Transferring files

```
# a file, to the server

scp archive.tar.gz root@203.0.113.20:/srv/



# a folder, synchronised

rsync -avz ./build/ root@203.0.113.20:/var/www/app/
```

SFTP software such as FileZilla or WinSCP connects over **SFTP**, with your server's address and your private key.

## Working from your editor

The **Remote - SSH** extension for Visual Studio Code opens your server's folders as if they were on your computer: it reads your `~/.ssh/config` file, so you simply choose `myultra`. JetBrains editors offer the same connection through **Remote Development**.

## Windows Server: Remote Desktop

A VPS Ultra running Windows Server opens with **Remote Desktop** (RDP):

1. On Windows, launch **Remote Desktop Connection** (`mstsc`); on macOS, Microsoft's **Windows App**; on Linux, Remmina.
2. Enter your server's IPv4 address, shown in its card.
3. Sign in with the administrator account provided by our team on delivery, then change its password at the first session.

Then protect your access: a long and unique password, and Remote Desktop restricted to your addresses in the Windows firewall.

## Frequently asked questions

### "Permission denied (publickey)": what should I check?[​](#permission-denied-publickey-what-should-i-check "Direct link to \"Permission denied (publickey)\": what should I check?")

1. The key used is the one you sent us: `ssh-keygen -lf ~/.ssh/id_ed25519.pub` displays its fingerprint.
2. Your command uses the user `root` and the address from your card.
3. If your key has another name, specify it: `ssh -i ~/.ssh/my_key root@...`.

Then describe the situation to support, with the command you ran and the message you got: Full-Stack Assistance helps you restore access.

### My connection drops when I stay idle.

Add `ServerAliveInterval 60` to your block in `~/.ssh/config`, and run long commands in `tmux` or `screen`, which keep them alive even when you are disconnected.
