---
title: File Management
slug: aidc/file-management
createdAt: 2025-12-01T11:11:09.000Z
---

## <font color="#1d50a2">FTP</font>

<font color="#1d05a2">Table 1 FTP Config</font>

| **Command**                                                                                                                                               | **Purpose**                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| **ftp server enable**                                                                                                                                     | Enable FTP server.                                 |
| **ftp server source \{vrf** *vrf\_name*\|**interface** \{**mgmt 0**\|**ethernet** *interface\_name*\|**link-aggregation** *lag-id* \|**vlan** *vlan-id*}} | Configure the source interface for the FTP server. |
| **ftp** \[**ip**\|**ipv6**] *ip\_address* \[**autologin**\|**vrf** *vrf\_name*\|**downloadtip**]                                                          | Login to other devices using FTP protocol.         |

### <font color="#1d50a2">ftp server enable</font>

**\[Command]**
**ftp server enable**

**\[Purpose]**
Enable FTP server.

**\[View]**
Global Configuration View

**\[Notes]**
FTP server is not enabled by default. The current FTP server only allows the 'admin' user to log in, and the corresponding FTP file root directory is /home/admin.
Run command **no ftp server enable** to disable FTP server.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ftp server enable
```

### <font color="#1d50a2">ftp server source \{vrf *vrf\_name*|interface \{mgmt 0|ethernet *interface\_name*|link-aggregation *lag-id* |vlan *vlan-id*\}\}</font>

**\[Command]**
**ftp server source\{vrf** *vrf\_name*|**interface** \{**mgmt 0**|**ethernet** *interface\_name*|**link-aggregation** *lag-id* |**vlan** *vlan-id*}}

**\[Purpose]**
Configure the source interface for the FTP server.

**\[Parameters]**

| **Parameter**     | **Description**                       |
| ----------------- | ------------------------------------- |
| *vrf\_name*       | VRF name, the default VRF is default. |
| *interface\_name* | Interface name (eg.0/1).              |
| *lag-id*          | LAG ID, the range is \[1,9999].       |
| *vlan-id*         | VLAN ID, the range is \[1,4094].      |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no ftp server source** to delete the source interface for the FTP server.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ftp server source interface ethernet 0/0
```

### <font color="#1d50a2">ftp \[ip|ipv6\] *ip\_address* \[autologin|vrf *vrf\_name*|downloadtip\]</font>

**\[Command]**
**ftp** \[**ip**|**ipv6**] *ip\_address* \[**autologin**|**vrf** *vrf\_name*|**downloadtip**]

**\[Purpose]**
Login to other devices using FTP protocol.

**\[Parameters]**

| **Parameter** | **Description**                       |
| ------------- | ------------------------------------- |
| *ip\_address* | IP address of devices.                |
| *vrf\_name*   | VRF name, the default VRF is default. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# ftp ip 10.250.0.167 autologin
Connected to 10.250.0.167.
220 (vsFTPd 3.0.3)
Name (10.250.0.167:admin): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
```

## <font color="#1d50a2">TFTP</font>

<font color="#1d05a2">Table 2 TFTP Config</font>

| **Command**                                                                                                                                                    | **Purpose**                                         |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **tftp server enable**                                                                                                                                         | Enable TFTP server.                                 |
| **tftp server source** \{**vrf** *vrf\_name*\|**interface** \{**mgmt 0**\|**ethernet** *interface\_name*\|**link-aggregation** *lag-id* \|**vlan** *vlan-id*}} | Configure the source interface for the TFTP server. |
| **tftp** \[**ip**\|**ipv6**] *ip\_address* \[**vrf** *vrf\_name*\|**port** *port\_id*]                                                                         | Login to other devices using TFTP protocol.         |

### <font color="#1d50a2">tftp server enable</font>

**\[Command]**
**tftp server enable**

**\[Purpose]**
Enable TFTP server.

**\[View]**
Global Configuration View

**\[Notes]**
TFTP server is not enabled by default. The corresponding TFTP file root directory is /srv/tftp/, which belongs to the ‘admin’ user, and only the ‘admin’ user is allowed to add or delete files within it. TFTP clients cannot add new files to the server or delete files from the server.They can download existing files on the server and also upload and update files on the server that have global write permissions.
Run command **no tftp server enable** to disable TFTP server.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# tftp server enable
```

### <font color="#1d50a2">tftp server source \{vrf *vrf\_name*|interface \{mgmt 0|ethernet *interface\_name*|link-aggregation *lag-id* |vlan *vlan-id*\}\}</font>

**\[Command]**
**tftp server source** \{**vrf** *vrf\_name*|**interface** \{**mgmt 0**|**ethernet** *interface\_name*|**link-aggregation** *lag-id*|**vlan** *vlan-id*}}

**\[Purpose]**
Configure the source interface for the TFTP server.

**\[Parameters]**

| **Parameter**     | **Description**                       |
| ----------------- | ------------------------------------- |
| *vrf\_name*       | VRF name, the default VRF is default. |
| *interface\_name* | Interface name (eg.0/1).              |
| *lag-id*          | LAG ID, the range is \[1,9999].       |
| *vlan-id*         | VLAN ID, the range is \[1,4094].      |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no tftp server source** to delete the source interface for the TFTP server.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# tftp server source interface ethernet 0/0
```

### <font color="#1d50a2">tftp \[ip|ipv6\] *ip\_address* \[vrf *vrf\_name*|port *port\_id*\]</font>

**\[Command]**
**tftp** \[**ip**|**ipv6**] *ip\_address* \[**vrf** *vrf\_name*|**port** *port\_id*]

**\[Purpose]**
Login to other devices using TFTP protocol.

**\[Parameters]**

| **Parameter**     | **Description**                       |
| ----------------- | ------------------------------------- |
| *vrf\_name*       | VRF name, the default VRF is default. |
| *interface\_name* | Interface name (eg.0/1).              |
| *port\_id*        | Port id                               |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# tftp ip 10.250.0.167
tftp>
```

## <font color="#1d50a2">SCP</font>

<font color="#1d05a2">Table 3 SCP Config</font>

| **Command**                                                                                                                                                                    | **Purpose**                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| **scp** \[**ip**\|**ipv6**] **source** *sourcefile* **target** *destinationfile* \[**vrf** *vrf\_name*\|**src** *source\_ip*\|**interface** *interface\_name*\|**foldercopy**] | Transfer files using SCP protocol |

### <font color="#1d50a2">scp \[ip|ipv6\] source *sourcefile* target *destinationfile* \[vrf *vrf\_name*|src *source\_ip*|interface *interface\_name*|foldercopy\]</font>

**\[Command]**
**scp** \[**ip**|**ipv6**] **source** *sourcefile* **target** *destinationfile* \[**vrf** *vrf\_name*|**src** *source\_ip*|**interface** *interface\_name*|**foldercopy**]

**\[Purpose]**
Transfer files using SCP protocol.

**\[Parameters]**

| **Parameter**     | **Description**                       |
| ----------------- | ------------------------------------- |
| *vrf\_name*       | VRF name, the default VRF is default. |
| *interface\_name* | Interface name (eg.0/1).              |
| *interface\_name* | Interface name (eg.0/1).              |
| *source\_ip*      | Source IPaddress.                     |
| **foldercopy**    | Batch copying files from a folder.    |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# scp ip source admin@10.250.0.167:/home/admin/1.txt target 114.txt
admin@10.250.0.167's password:
1.txt                                                                                                                                                            100%    5     1.7KB/s   00:00
sonic#
```

