第一步:证书准备
cd /etc/pki/CA
openssl req -newkey rsa:2048 -x509 -days 365 -out
// CN-HN-SY-SYZY-XXJS-CA_ROOT (剩下的都按回车)
cacert.pem -keyout cakey.pem
mv cakey.pem private/
cd ~/certs
openssl req -newkey rsa:2048 -new -out r1csr.csr -keyout r1key.pem
// CN-HN-SY-SYZY-XXJS-R1 (剩下的都按回车)
openssl req -newkey rsa:2048 -new -out r2csr.csr -keyout r2key.pem
// CN-HN-SY-SYZY-XXJS-R2 (剩下的都按回车)
使用CA为r1和r2颁发证书
touch /etc/pki/CA/index.txt
echo 01 > /etc/pki/CA/serial4
openssl ca -in r1csr.csr -out r1cert.pem
openssl ca -in r1csr.csr -out r1cert.pem
导出目录~/certs
导出目录cd /etc/pki/CA/
下的cacert.pem
第二步
ENSP拓扑图准备
两台client的基础配置
# r1
sys
sys r1
int g0/0/1
ip ad 172.16.1.1 24
quit
# r2
sys
sys r1
int g0/0/2
ip ad 172.16.1.1 24
quit
# r1 & r2
ftp server enable
local-user ftpuser password cipher 123456
local-user ftpuser privilege level 15
local-user ftpuser ftp-directory flash:/
local-user ftpuser service-type ftp
打开client1和client2 进入客户端消息
注:如果连接不上或者密码没有错误,但是报密码错误,那么使用命令local-user ftpuser privilege level 15
登入成功后,client1传输文件r1key.pem
,r1cert.pem
,cacert.pem
,client2传输文件r2key.pem
,r2cert.pem
,cacert.pem