---
title: "Create remote server transfer session as root user"
method: GET
path: "/create_remote_root_transfer_session"
tags: ["Transfers", "cPanel Account Transfer"]
---

# Create remote server transfer session as root user

`GET /create_remote_root_transfer_session`

This function creates a transfer session as the `root` user.

**Important:**

  For information about the ports that cPanel & WHM uses, read our [How to Configure Your Firewall for cPanel Services](https://go.cpanel.net/firewall) documentation.

**Note:**

  For more information about how this function works with other functions in the transfer and restore process, read our [Guide to Transfer and Restore API Functions](https://go.cpanel.net/transferrestoreAPIguide) documentation.

### Authentication
There are several methods that you can use to authenticate a transfer session with the remote server:

#### Authenticate as root
If you use SSH to authenticate as the `root` user, the remote server's SSH must accept `root` logins. For more information read [OpenSSH's `sshd_config`](https://linux.die.net/man/5/sshd_config) documentation.

The following table displays the correct parameters and values for this authentication method:

| Parameter | Value |
|-|-|
| `user` | `root` |
| `password` | `root`'s password |

You can also use an SSH public key to authenticate the `root` user. If the SSH public key is encrypted, include the SSH key's passphrase.

The following table displays the correct parameters and values for this authentication method:

| Parameter | Value if the SSH Key is not encrypted | Value if the SSH Key is encrypted |
|-|-|-|
| `user` | `root` | `root` |
| `sshkey_name` | The `root` user's SSH key. | The `root` user's SSH key. |
| `sshkey_passphrase` | *(none)* | The `root` user's SSH key passphrase. |

#### Authenticate as a user
Many server administrators do not permit direct `root` logins via SSH on their servers.
* If the remote server forbids root logins, you **must** use another user and their password on the remote server, and then escalate to the `root` user. For more information read [OpenSSH's `sshd_config`](https://linux.die.net/man/5/sshd_config) documentation.
* If the system administrator used WHM's [*Manage Wheel Group Users*](https://go.cpanel.net/whmdocsManageWheelGroupUsers) interface (*WHM >> Home >> Security Center >> Manage Wheel Group Users*) to grant the user `su` access, then you will need to specify `su` and the `root` password.
* If the user has `sudo` access, you do **not** need the `root` password.

The following table displays the correct parameters and values for this authentication method:

| Parameter | Value if the user has sudo access | Value if the user has su access |
|-|-|-|
| `user` | The username. | The username. |
| `password` | The user's password. | The user's password. |
| `root_escalation_method` | `sudo` | `su` |
| `root_password` | *(none)* | The `root` user's password. |

You can also use an SSH public key instead of a password to authenticate that user. If the SSH public key is encrypted, include the SSH key's passphrase.

The following table displays the correct parameters and values for this authentication method:

| Parameter | sudo | su |
|-|-|-|
| `user` | The username. | The username. |
| `sshkey_name` | The user's SSH key. | The user's SSH key. |
| `sshkey_passphrase` (If encrypted) | The user's SSH key passphrase. | The user's SSH key passphrase. |
| `root_escalation_method` | `sudo` | `su` |
| `root_password` | *(none)* | The `root` user's password. |

## Query parameters

- `comm_transport` 'ssh' | 'whostmgr' | 'whostmgr_insecure', required
- `compressed` 0 | 1, required
- `copy_reseller_privs` 0 | 1, required
- `enable_custom_pkgacct` 0 | 1, required
- `host` union, required
  - string, ipv4 — A valid IP address.
  - string, domain — A valid domain.
- `low_priority` 0 | 1, required
- `restore_threads` integer, required
- `transfer_threads` integer, required
- `unencrypted` 0 | 1, required
- `unrestricted_restore` 0 | 1, required
- `use_backups` 0 | 1, required
- `user` string, required
- `password` string
- `port` integer
- `root_escalation_method` 'su' | 'sudo'
- `root_password` string
- `sshkey_name` string
- `sshkey_passphrase` string

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `analyze_rawout` string — The HTML output from the analysis of the remote server connection.
    - `create_rawout` string — The HTML output from the creation of the remote server connection.
    - `transfer_session_id` string — The transfer session's ID.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` - Success. * `0` - Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
