linux加密认证全面分析

简介:




基础了解篇:

1)对称加密

在对称加密算法中,数据发信方将明文(未加密前的数据)和加密密钥一起经过特殊加密算法处理后,使其变成复杂的加密密文(加密后的数据)发送出去。收信方收到密文后,若想解读原文,则需要使用加密用过的密钥及相同算法的逆算法对密文进行解密,才能使其恢复成可读明文。也就是说加密和解密使用相同的密码,对称加密解密的特点是运算相对非对称加密解密简单、速度块。具有代表性的有DESAES 3DES

  NASTDESData Encryption Standard数据加密标准,使用56位的密钥实现8轮置换进行加密。

AESAdvanced):高级加密标准,使用的是128位,192位,256位长度的密钥,可以随意选择。

2)非对称加密/解密

非对称加密算法在加密和解密时使用不同的密码。如果使用公钥(是从私钥中提取出来的)对数据进行加密,使用与之配对的私钥解密;如果用私钥对数据进行加密,那么只有用配对的公钥才能解密。非对称加密的安全性是基于数学函数,特点是运算复杂、速度慢;所以很少有人拿来为大量数据加密。具有代表性的有RSADSSECC

解析:

私钥公钥适于做身份验证不适于做网络加密

公钥私钥能保障数据的机密性适于加密认证

3)单向加密

特点:不管加密的数据多长都会定长输出;不可逆转即无法将得到的数据在逆着解密;但是会形成只要数据微小的变化就会导致结果的巨大变化也就是雪崩效应。

单项加密也可以实现数据完整性和实现身份的验证。关于实现的过程笔者懂但是无法描述清晰只好借助某大神表述:

完整性验证:

   A先用单向加密数据将得到的数据再用自己的私钥加密附在数据之后发给B;B收到数据后若能用A的公钥解密出加过密的特征码则说明这就是A发来的数据,若用单向加密数据能得到和A发来的一模一样的特征码说明此数据没被别人篡改过这样就保证了数据的完整性

身份验证:

   A用单向加密要发给B的数据得到特征码,再用自己的私钥加密此特征码,将加过密的特征码附加在数据之后A会用自己生成的对称密钥加密这两段数据再用A的公钥加密生成的密钥再次附件在加过密的两段数据之后发给B;B收到数据后用自己的私钥解密出密码然后用此密码解密出数据,若B能用A的公钥解出附加在数据之后的特征码就说明这就是A发来的数据,若B用单向加密得到的数据特征码和A发来的一模一样则说明此数据未被篡改过如此一来身份验证,数据完整性和数据加密便都可实现了但此过程也会遇到无法保证得到的公钥就是要通信的一方的公钥。

说实话这位大神的表述我晕了,望各位看客能够清晰对待啊!

小加密认证结:利用以上三种加密机制完成一次完整意义上的加密通信:

        1、发送方使用选定的单向加密算法计算原始数据的特征码;

        2、发送方使用自己的私钥加密特征码,附加于原始数据后面;

        3、发送方生成一次性对称密钥,并使用此密钥加密数据(原始数据+加密后的特征码);

        4、发送方使用接收方的公钥加密一次性对称密钥,附加于加密数据后面

        5、发送;


        1、接收方使用自己的私钥解密加密的一次性对称密钥;

        2、使用对称密钥解密数据,得到加密的特征码和原始数据;

        3、使用发送方的公钥解密加密的特征码;

        4、使用与发送方相同的单向加密算法重新计算数据的特征码,并与解密出的特征做比较;


   PKI是Public KeyInfrastructure的缩写,是指用公钥概念和技术来实施和提供安全服务的具有普适性的安全基础设施。

一个典型、完整、有效的PKI应用系统至少应具有以下部分:

   端实体(申请者)、注册机构(RC)、签证机构(CA)、证书撤消列表(CRL)发布机构、证书存取库。



操作实践篇:

OpenSSL工具的使用

   OpenSSL 为网络通信提供安全及数据完整性的一种安全协议,囊括了主要的密码算法、常用的密钥和证书封装管理功能以及SSL协议,并提供了丰富的应用程序供测试或其它目的使用。

   Openssl主要有三部分组成:

      libcrypto:加密解密程序库

      libssl:实现ssl功能

      openssl:多功能多用途的命令行程序


1)显示版本信息:使用命令openssl version

1
2
[root@localhost ~] # openssl version
OpenSSL 1.0.0-fips 29 Mar 2010


2)加密测试:使用命令openssl enc加密:

1
2
3
4
5
6
7
8
9
[root@localhost ~] # cp /etc/fstab ./        #复制一个文件进行加密测试
[root@localhost ~] # ls
anaconda-ks.cfg  fstab         install .log.syslog  zsh-4.3.10-5.el6.x86_64.rpm
File              install .log  xx.sh
[root@localhost ~] # openssl enc -des3 -in fstab -e -out fstab.des3   #加密
enter des-ede3-cbc encryption password:                  #输入密码
Verifying - enter des-ede3-cbc encryption password:     #再次输入密码,确认
[root@localhost ~] # cat fstab.des3                      #查看加密结果
Salted__(? ).q?.?.Os

  解析:openssl enc指定加密的类型,-in指定要加密的文件,-e表示加密,-out表示指定加密后要保存的位置


3)解密测试:也是使用openssl enc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@localhost ~] # rm -rf fstab               #将文件删除
[root@localhost ~] # openssl enc -des3 -d -in fstab.des3 -out fstab.txt       #解密文件
enter des-ede3-cbc decryption password:                              #输入加密的密码
[root@localhost ~] # cat fstab.txt                                     #查看结果
#
# /etc/fstab
# Created by anaconda on Fri Jul 12 18:24:30 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg0-root     /                       ext4    defaults        1 1
UUID=b60d1298-6614-4daa-89d2-1af13f7e9a66  /boot                    ext4    defaults        1 2
/dev/mapper/vg0-usr      /usr                     ext4    defaults        1 2
/dev/mapper/vg0-var      /var                     ext4    defaults        1 2

解析:openssl enc指定加密的类型,-d表示解密,-in指定加密后的文件,-out表示指定解密后要保存的位置


4)获取文件特征码:使用命令openssl dgst

1
2
3
4
5
6
7
[root@localhost ~] # openssl dgst -md5 fstab.txt           #获取特征码
MD5(fstab.txt)= 6e4fe954c8b3e71a44b6c19f4a735453
[root@localhost ~] # openssl dgst -md5 -hex fstab.txt       #获取16进制特征码,默认是可省略
MD5(fstab.txt)= 6e4fe954c8b3e71a44b6c19f4a735453
[root@localhost ~] # vim fstab.txt                       #编辑一下此文档
[root@localhost ~] # openssl dgst -md5 -hex fstab.txt       #重新获取特征码
MD5(fstab.txt)= b85044cee63d32fa77dcc2e0c79b90bd      #几乎都不同,这就是雪崩效应

小拓展:使用md5sum同样可以获取文件特征码

1
2
[root@localhost ~] # md5sum fstab.txt
b85044cee63d32fa77dcc2e0c79b90bd  fstab.txt              #获取结果是相同的


5)测试当前主机支持加密算法的速度:使用命令openssl speed

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost ~] # openssl speed des-ede3               #测试des3的加密算法速度(不加参数会将所有算法都测试一遍)
Doing des ede3  for  3s on 16 size blocks: 1838583 des ede3's  in  2.99s
Doing des ede3  for  3s on 64 size blocks: 461948 des ede3's  in  3.00s
Doing des ede3  for  3s on 256 size blocks: 108654 des ede3's  in  2.99s
Doing des ede3  for  3s on 1024 size blocks: 28366 des ede3's  in  3.00s
Doing des ede3  for  3s on 8192 size blocks: 3671 des ede3's  in  2.99s
OpenSSL 1.0.0-fips 29 Mar 2010
built on: Thu Feb 21 23:42:57 UTC 2013
options:bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM
The  'numbers'  are  in  1000s of bytes per second processed.
type              16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
des ede3          9838.57k     9854.89k     9302.82k     9682.26k    10057.80k


6)随机生成随机数 openssl rand:

1
2
[root@localhost ~] # openssl rand -hex 4           #随机生成8位的随机数
5e3acc9c


7)计算密码值 openssl passwd:

1
2
3
[root@localhost ~] # openssl passwd -1 -salt 12345678     #通过salt后加密计算密码值
Password:                                          #输入密码
$1$12345678$0ME5N6oDyoEAwUp7b5UDM/             #生成的值

 解析:其中-1表示基于MD5的加密算法;-sart添加一些额外数(一般为8位)尽量使用无规律的随机数。更多请参考man sslpasswd

1
2
3
[root@localhost ~] # openssl passwd -1 -salt `openssl rand -hex 4`    #使用salt为随机数计算密码值
Password:
$1$c4d7ecb7$FUfRyYSh0OHTCp0D4paqr.


8)生成RSA算法的私钥:openssl genrsa:

1
2
3
4
5
6
7
8
9
10
11
[root@localhost ~] # openssl genrsa 1024 > mykey.rs  #也可用openssl genrsa -out mykey.rs 1024
Generating RSA private key, 1024 bit long modulus
............++++++
.............++++++
e is 65537 (0x10001)
[root@localhost ~] # cat mykey.rs           
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCfSs+B4SngclkdU32dpsEurEQQhmmKg5EbCGD6mqcxhcZQpBAh
oG2O60 /9js1NOcqjUug58HvEeVOY6khnD7XyLoNrCjYm2DnPaRRcATa70ijUTmqk
1hzwLZAp81L22mf4C4tkBuayc1sCS /F +hZVxnKXd3AtIuVE0DczCK8NkmQIDAQAB
AoGAf24Nis1h /tf7SmacOx5HtNrCqKWekNynnISbcF +AGTH3cFOPRBdfDdJZb3Jp

  解析:openssl genrsa后可直接跟位数,默认为512位;也可使用重定向将内容保存在某文件中,若想加密私钥可使用openssl genrsa直接跟加密算法进行加密;更多请参考man genrsa

由于是私钥所以不应该让别人具有查看权限的所以要改为600或者400权限或者使用如下命令定义权限获取私钥:

1
2
3
4
5
6
7
8
9
10
11
12
[root@localhost ~] # ls -l
total 2276
-rw-------. 1 root root    2409 Jul 12 18:47 anaconda-ks.cfg
-rw-r--r--  1 root root     887 Aug  5 23:32 mykey.rs         #默认所有人都有权限
[root@localhost ~] # (umask 077; openssl genrsa -out /root/mykey2.pri 2048)  #mask定义权限获取私钥
Generating RSA private key, 2048 bit long modulus
........................................................+++
....................+++
e is 65537 (0x10001)
[root@localhost ~] # ls -l
total 2280
-rw-------  1 root root    1679 Aug  5 23:57 mykey2.pri     #文件权限

  解析:谨记这里使用mask设置权限一定要加上括号不然后面创建所有的文件都会变成此权限的,因为它是一直生效的;使用括号表示此命令在一个子shell中执行,完成子shell退出



9)生成RSA的公钥openssl rsa

1
2
3
4
5
6
7
8
[root@localhost ~] # openssl rsa -in mykey.rs -pubout
writing RSA key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfSs+B4SngclkdU32dpsEurEQQ
hmmKg5EbCGD6mqcxhcZQpBAhoG2O60 /9js1NOcqjUug58HvEeVOY6khnD7XyLoNr
CjYm2DnPaRRcATa70ijUTmqk1hzwLZAp81L22mf4C4tkBuayc1sCS /F +hZVxnKXd
3AtIuVE0DczCK8NkmQIDAQAB
-----END PUBLIC KEY-----

 解析:使用openssl rsa –in 指定私钥文件使用-pubout显示公钥信息


10)证书签署请求openssl req

  数字证书主要包含以下部分:版本号(version);序列号(证书本身在CA中惟一标识);签名算法标志;发行者名称;有效期;证书主体名称:(组织(主机),个人);证书主体公钥信息;发行商惟一标志;证书主体的惟一标志;扩展;签名。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@localhost ~] # openssl req -new -key /root/mykey.pri -out /root/myreq.csr        #证书签署请求
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter  '.' , the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN                    #国家名
State or Province Name (full name) []:Henan              #省份名称
Locality Name (eg, city) [Default City]:Zhengzhou           #城市名称
Organization Name (eg, company) [Default Company Ltd]:Magedu       #单位名称
Organizational Unit Name (eg, section) []:Tech             #部门名称
Common Name (eg, your name or your server's  hostname ) []:www.magedu.com      #证书拥有者名称,若在必须为用户访问时的名称,若使用域名访问这里是域名,若是IP地址这里一定是IP地址
Email Address []:admin@magedu.com              #邮箱地址(可省略不写)
Please enter the following  'extra'  attributes
to be sent with your certificate request
A challenge password []:                        #将请求加密起来输入密码,不想直接回车即可
An optional company name []:
#这些要输入的组织信息可以在[root@localhost ~]vim /etc/pki/tls/ openssl.cnf进行更改默认选项设置,这里就不予以说明了;需要注意的是Common Name一定不能使用默认选项啊!!
#这样证书申请就结束了。

   解析:openssl req(证书签署请求和证书生成工具)中-key指定私钥文件的路径(可自动完成提取公钥功能);-new指定证书申请;-days明确指定证书申请有效使用期限;-out 将此证书保存为什么文件,通常为.csr结尾的文件;其他更多请man req


11)如何自建CA

  •   查看解析配置文件


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[root@localhost ~] # cd /etc/pki/tls/                     #openssl配置文件目录
[root@localhost tls] # vim openssl.cnf                    #编辑配置文件
####…前方不重要已省略…####
tsa_policy3 = 1.2.3.4.5.7
####################################################################
[ ca ]                                #子命令;更改只对子命令生效
default_ca      = CA_default             # The default ca section
####################################################################
[ CA_default ]
dir              /etc/pki/CA          # Where everything is kept    #自建CA的工作目录
certs           = $ dir /certs            # Where the issued certs are kept     #指定当前CA的证书存取库的存放位置
crl_dir         = $ dir /crl               # Where the issued crl are kept       #指定证书撤销列表所在工作目录
database        = $ dir /index .txt         # database index file.         #将签署的证书制作成索引保存下来也就是数据库文件
#unique_subject = no                  # Set to 'no' to allow creation of
                                     # several ctificates with same subject.
new_certs_dir   = $ dir /newcerts          # default place for new certs.     #新签证书的位置
certificate     = $ dir /cacert .pem        # The CA certificate            #CA自己的证书位置
serial          = $ dir /serial            # The current serial number     #已签证书,序列号
crlnumber       = $ dir /crlnumber         # the current crl number     #已吊销证书个数
                                         # must be commented out to leave a V1 CRL
crl             = $ dir /crl .pem           # The current CRL     #当前的证书吊销文件是什么
private_key     = $ dir /private/cakey .pem # The private key       #证书颁发机构自己的私钥文件
RANDFILE        = $ dir /private/ .rand     # private random number file
x509_extensions = usr_cert               # The extentions to add to the cert

  •  自建CA过程

  生成一个私钥;

1
2
3
4
5
6
[root@localhost tls] # cd /etc/pki/CA/
[root@localhost CA] # (umask 077; openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus
......+++
...................+++
e is 65537 (0x10001)

 申请自签证书

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@localhost CA] # openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 365   #-x509指定证书格式(加这个选项表示自签证书不加表示申请证书);-days 365 使用期限一年
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter  '.' , the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN              #自签证书要在一个组织内,不然不予理睬
State or Province Name (full name) []:Henan
Locality Name (eg, city) [Default City]:Zhengzhou
Organization Name (eg, company) [Default Company Ltd]:Magedu
Organizational Unit Name (eg, section) []:Tech
Common Name (eg, your name or your server's  hostname ) []:ca.magedu.com
Email Address []:caadmin@magedu.com

 创建一个序列号文件和一个数据库文件

1
2
[root@localhost CA] # touch serial index.txt
[root@localhost CA] # echo 01 > serial        #让此序列号文件从01开始


12)使用此CA帮别人签署证书:命令 openssl ca

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[root@localhost ~] # openssl ca -in myreq.csr -out mycert.crt -days 365    #签署证书
Using configuration from  /etc/pki/tls/openssl .cnf
Check that the request matches the signature
Signature ok
Certificate Details:
         Serial Number: 1 (0x1)
         Validity
             Not Before: Aug  5 18:17:55 2013 GMT
             Not After : Aug  5 18:17:55 2014 GMT
         Subject:
             countryName               = CN
             stateOrProvinceName       = Henan
             organizationName          = Magedu
             organizationalUnitName    = Tech
             commonName                = www.magedu.com
             emailAddress              = admin@magedu.com
         X509v3 extensions:
             X509v3 Basic Constraints:
                 CA:FALSE
             Netscape Comment:
                 OpenSSL Generated Certificate
             X509v3 Subject Key Identifier:
                 F5:21:BC:A2:8B:19:FC:41:DF:41:99:68:E7:90:4D:E5:3F:37:BF:A5
             X509v3 Authority Key Identifier:
                 keyid:AE:3D:F8:00:7A:A0:69:C5:B1:1C:F1:9A:20:B2:F0:B0:45:51:FC:32
Certificate is to be certified  until  Aug  5 18:17:55 2014 GMT (365 days)
Sign the certificate? [y /n ]:y              #是否确定签署
1 out of 1 certificate requests certified, commit? [y /n ]y       #再次验证
Write out database with 1 new entries
Data Base Updated

 解析:openssl ca使用CA签署证书,-in 申请文件;-out生成证书文件(一般证书文件都是以.crt为后缀的文件;-days签署的天数);


13)ssl专用的客户端测试工具:openssls_client

1
#格式:openssl s_client -connect HOST:PORT –CAfile /path/to/cacertfile |-CApath /paht/to/cacertfiles_dir/ -ssl2|-ssl3|-tls1

 解析:-connect后指定哪个服务器:端口号;–CAfile /path/to/cacertfile 指定使用哪个CA证书去验证| -CApath/paht/to/cacertfiles_dir/使用哪个目录下的哪个CA去验证 -ssl2|-ssl3|-tls1指定ssl协议的版本



续上篇博文《红帽系列文件共享服务解析》中的CA认证:怎么利用sslftp进行加密认证传输?

   思路:自建CA—> 签署协议—> 测试验证

   过程:


自建CA,这里刚刚建立结束就不在重复了


FTP申请一个证书颁发请求

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@localhost ~] # cd /etc/vsftpd/                   #切换到Ftp目录下来
[root@localhost vsftpd] # mkdir ssl                    #创建一个文件夹存放私钥
[root@localhost vsftpd] # cd ssl
[root@localhost ssl] #  (umask 077; openssl genrsa -out vsftpd.key 2048)   #生成私钥
Generating RSA private key, 2048 bit long modulus
.................................................................+++
....................................+++
e is 65537 (0x10001)
[root@localhost ssl] # openssl req -new -key vsftpd.key -out vsftpd.csr      #申请证书签署
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter  '.' , the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:Henan
Locality Name (eg, city) [Default City]:Zhengzhou
Organization Name (eg, company) [Default Company Ltd]:Magedu
Organizational Unit Name (eg, section) []:Tech
Common Name (eg, your name or your server's  hostname ) []: ftp .magedu.com
Email Address []:admin@magedu.com
Please enter the following  'extra'  attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:


CA签署证书

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[root@localhost ssl] # openssl ca -in vsftpd.csr -out vsftpd.crt -days 365    #证书签署
Using configuration from  /etc/pki/tls/openssl .cnf
Check that the request matches the signature
Signature ok
Certificate Details:
         Serial Number: 2 (0x2)
         Validity
             Not Before: Aug  5 19:02:07 2013 GMT
             Not After : Aug  5 19:02:07 2014 GMT
         Subject:
             countryName               = CN
             stateOrProvinceName       = Henan
             organizationName          = Magedu
             organizationalUnitName    = Tech
             commonName                =  ftp .magedu.com
             emailAddress              = admin@magedu.com
         X509v3 extensions:
             X509v3 Basic Constraints:
                 CA:FALSE
             Netscape Comment:
                 OpenSSL Generated Certificate
             X509v3 Subject Key Identifier:
                 BC:AC:5D:EE:D5:F6:E4:61:58:47:9A:93:C4:B3:F8:23:AB:93:E7:63
             X509v3 Authority Key Identifier:
                 keyid:AE:3D:F8:00:7A:A0:69:C5:B1:1C:F1:9A:20:B2:F0:B0:45:51:FC:32
Certificate is to be certified  until  Aug  5 19:02:07 2014 GMT (365 days)
Sign the certificate? [y /n ]:y
1 out of 1 certificate requests certified, commit? [y /n ]y
Write out database with 1 new entries
Data Base Updated
[root@localhost ssl] # ls                         #查看
vsftpd.crt  vsftpd.csr  vsftpd.key
[root@localhost ssl] #


更改配置文件,实现基于ssl访问

1
2
3
4
5
6
7
8
9
10
11
[root@localhost vsftpd] # vim vsftpd.conf
#SSL
ssl_enable=YES                           #是否支持ssl
ssl_tlsv1=YES                             #支持tlsv1
ssl_sslv2=YES                             #支持sslv2
ssl_sslv3=YES                             #支持sslv3
allow_anon_ssl=NO                        #匿名用户无法访问
force_local_data_ssl=YES                    #本地数据访问使用ssl
force_local_logins_ssl=YES                   #本地用户登录使用ssl
rsa_cert_file= /etc/vsftpd/ssl/vsftpd .crt         #指定ssl证书
rsa_private_key_file= /etc/vsftpd/ssl/vsftpd .key          #指定ssl私钥文件


重新启动服务

1
2
3
[root@localhost vsftpd] # service vsftpd reload
Shutting down vsftpd:                                         [  OK  ]
Starting vsftpd  for  vsftpd:                                   [  OK  ]


使用基于SSl登录系统

205102496.png

205109470.png

   解析:这里由于证书名称和ftp连接服务器的名称写的不一致所有会导致证书不匹配,所以以后我们要把证书名称设置一致。

205647104.png

   连接成功,这时所有的操作都是基于ssl证书进行了。


总结:加密认证技术涵盖所有服务器;应认真对待好好熟练。j_0006.gif




本文转自 z永 51CTO博客,原文链接:http://blog.51cto.com/pangge/1280171



相关文章
|
23天前
|
Linux 数据安全/隐私保护 Windows
aes加密在linux下会生成随机key的解决办法
aes加密在linux下会生成随机key的解决办法
12 2
|
1月前
|
Linux 网络安全 数据安全/隐私保护
Linux vsFTPd服务详解——文件加密传输配置
Linux vsFTPd服务详解——文件加密传输配置
143 2
|
1月前
|
Linux Android开发
嵌入式linux中Framebuffer 驱动程序框架分析
嵌入式linux中Framebuffer 驱动程序框架分析
27 0
|
1月前
|
Linux C语言 SoC
嵌入式linux总线设备驱动模型分析
嵌入式linux总线设备驱动模型分析
32 1
|
1月前
|
Linux
嵌入式linux系统设备树实例分析
嵌入式linux系统设备树实例分析
35 0
|
1月前
|
监控 Shell Linux
【Shell 命令集合 网络通讯 】Linux 分析串口的状态 statserial命令 使用指南
【Shell 命令集合 网络通讯 】Linux 分析串口的状态 statserial命令 使用指南
33 0
|
21天前
|
Prometheus 监控 数据可视化
linux分析方法与技巧
【4月更文挑战第3天】在Linux环境中,进行日志分析和系统性能分析的关键方法包括:使用`cat`, `less`, `tail`查看和过滤日志,`logrotate`管理日志文件,`rsyslog`或`syslog-ng`聚合日志,以及通过`top`, `mpstat`, `pidstat`, `free`, `iostat`, `netstat`, `strace`, `sar`, `dstat`等工具监控CPU、内存、磁盘I/O和网络。对于高级分析,可利用Brendan Gregg的性能工具,以及Grafana、Prometheus等可视化工具。
17 2
linux分析方法与技巧
|
28天前
|
监控 Linux Shell
Linux 进程问题调查探秘:分析和排查频繁创建进程问题
Linux 进程问题调查探秘:分析和排查频繁创建进程问题
39 0
|
28天前
|
消息中间件 存储 网络协议
Linux IPC 进程间通讯方式的深入对比与分析和权衡
Linux IPC 进程间通讯方式的深入对比与分析和权衡
69 0
|
28天前
|
存储 监控 Linux
Linux 使用getrusage系统调用获取cpu信息:一个C++实例分析
Linux 使用getrusage系统调用获取cpu信息:一个C++实例分析
48 0