目录
一、自动配置文件需求
网络中有多台华三交换机,需要每天一定时自动备份配置,并且简单易用。
二、环境条件
交换机:型号S6805-56HF-G,版本Version 7.1.070, Release 6010P03
ssh服务器:centos7.9
三、自动配置文件备份思路
1、使用Linux搭建ssh服务,配置好用户权限和目录权限,测试能ssh登录和上传;
2、华三交换机配置好自动配置的服务器、目录、vrf、文件名、账号密码这些;
3、运行过程就是华三交换机通过定时任务执行scp登录ssh服务器,将配置文件上传到指定目录;
四、搭建SCP服务器(其实就是SSH服务器)
注:ssh安装可自行百度
1)创建用户
adduser h3c //添加一个名为h3c的用户
passwd h3c //修改密码
2)编辑用户权限
vi /etc/sudoers
h3c ALL=(ALL) ALL
3)开启用户密码登录功能
//安全基线关闭了密码登录功能,需要启用密码登录
vi /etc/ssh/sshd_config
PasswordAuthentication yes
#PasswordAuthentication no
重启ssh服务
systemctl restart sshd.service
五、交换机配置自动备份
archive configuration server scp 10.100.100.100 vpn-instance guanli directory /home/h3c/ydjf/ filename-prefix hs68_wai
//注意写服务器的绝对路径
archive configuration server user h3c
archive configuration server password simple xxxxxx
archive configur