# Backup and restore configuration using Secure SHell (SSH)

scp must be enabled
```cisco
enable
conf t
ssh enable scopy
```

dump running-config into file
```cisco
copy running-config flash:/running-config
dir
```


SSH weak algorithms and ciphers need to be enabled
```bash
vi ~/.ssh/config
```
config
```
Host 192.168.74.1
    KexAlgorithms +diffie-hellman-group14-sha1
    HostKeyAlgorithms +ssh-rsa
    Ciphers +aes256-cbc
```

Pull config (-O tells to use legacy SCP protocol instead of SFTP)
```bash
scp -O r00t@192.168.74.1:running-config .
ls -la
```

[![](https://storage.googleapis.com/iau-data-dox/uploads/images/gallery/2025-11/scaled-1680-/njY5lr1iryC9YpWQ-image-1763826777428.png)](https://storage.googleapis.com/iau-data-dox/uploads/images/gallery/2025-11/njY5lr1iryC9YpWQ-image-1763826777428.png)

Rename config for archive
```bash
TODO
```

# Restore

Push config 

```bash
TODO
```