# Disconnect and force disconnect

Source: https://openpanel.sh/docs/servers/disconnect

Take a server out of OpenPanel, what a clean disconnect removes and keeps, how you sign in afterwards, and when to use force disconnect.

There are two ways to take a server out of OpenPanel. Both are at the bottom of a ready server's page, under **Disconnect**, for the Owner and Admins.

| | **Disconnect** | **Force disconnect** |
|---|---|---|
| For | A server you want back | A server that is lost or cannot be reached |
| Signs in to the server | Yes, one last time | No |
| Removes OpenPanel's things from the server | Yes | No |
| Takes the server off the private network | Yes | Yes |
| Revokes the agent's key | Yes | Yes |
| Gives you a way to sign in | Yes: password sign-in over SSH | No: you keep the console password you saved |
| Afterwards in OpenPanel | Listed as **Disconnected** until you remove it | Gone from the list |

Services that run on the server stop in both cases.

## Disconnect [#disconnect]

<Steps>
<Step>
### Start it [#start-it]

On the server's page, under **Disconnect**, choose **Disconnect**, read the list and choose **Disconnect** again. Choose **Keep it** to stop.
</Step>

<Step>
### OpenPanel cleans up [#openpanel-cleans-up]

OpenPanel signs in one last time and:

- stops the [agent](/docs/servers/agent) and removes its program and service, so it cannot start anything again;
- removes the containers and volumes it manages (those labelled `openpanel.managed=true`). Their data is deleted;
- takes the server out of the private network: Tiltas signs out and is uninstalled, its two firewall rules go, and the device is removed from the network;
- removes `/etc/openpanel` and the `sudoers` file it added;
- turns password sign-in back on for `openpanel` over SSH, on the same port, and lets other users sign in with a password again;
- removes its key from `openpanel`'s `authorized_keys`.

Then it revokes the agent's key, so the gateway refuses it from then on.

If OpenPanel cannot sign in, nothing is removed and the server stays **Ready**. The console says why, and suggests **Force disconnect** if the server is gone for good.
</Step>

<Step>
### Save the access [#save-the-access]

The page turns into the **Disconnected** page, with the access OpenPanel gave back:

| Row | Example |
|---|---|
| **Host** | `203.0.113.10` |
| **SSH port** | `41873` |
| **User** | `openpanel` |
| **Password** | The console password, the same for root and `openpanel` |
| **Sign in with** | `ssh -p 41873 openpanel@203.0.113.10` |

Save the password somewhere safe, for example in your password manager.
</Step>

<Step>
### Remove the server from the list [#remove-the-server-from-the-list]

Choose **I saved it, remove the server**. After this the access cannot be shown again.
</Step>
</Steps>

### What stays on the server [#what-stays-on-the-server]

- The firewall, with the SSH port, 80 and 443 open, and its rules for the ports Docker publishes. It only protects the server.
- `fail2ban` and automatic security updates.
- Docker, and anything you ran yourself outside OpenPanel.
- The user `openpanel`, which can still use `sudo` (with its password now).
- SSH on the port the setup picked, with root sign-in off.

### Signing in afterwards [#signing-in-afterwards]

```bash
ssh -p 41873 openpanel@203.0.113.10
```

Use the port, address and password from the **Disconnected** page. Root cannot sign in over SSH; use `sudo` as `openpanel`. In your provider's web console or at the machine itself, root and `openpanel` both take the same password.

To connect the server to OpenPanel again, reinstall it first.

## Force disconnect [#force-disconnect]

Use it only for a server that is lost, deleted at the provider, or cannot be reached.

On the server's page, under **Disconnect**, choose **Force disconnect**, tick **I understand that nothing is removed from the server.** and choose **Force disconnect**.

OpenPanel does not sign in to the server. It:

1. takes the server off the organization's private network, so it reaches nothing there any more. If the network service does not answer, the server is kept and the console asks you to try again in a minute;
2. revokes the agent's key, so the agent can no longer connect, and ends its connection within a minute;
3. forgets the server in OpenPanel.

Everything OpenPanel put on the machine stays there if it ever comes back online: the agent's program, containers and their data, secrets, and OpenPanel's key. Reinstall or wipe the server before anyone uses it again.

## Remove a server whose setup failed [#remove-a-server-whose-setup-failed]

A server that shows **Setup failed** has **Remove** instead. It forgets the server without signing in to it. What the setup already changed stays on the machine, for example the user `openpanel`, its key or a new SSH port. Reinstall the server before you connect it again.

## Who can disconnect [#who-can-disconnect]

Only the Owner or an Admin. See [Roles](/docs/members/roles).