linuxaes
1. 如何查看linux版本的型号
Linux系统如何查看版本信息
1、查看当前操作系统内核信息
uname -a
$ uname -a
Linux vm-web 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
2、查看当前操作系统版本信息
cat /proc/version
$ cat /proc/version
Linux version 3.10.0-693.21.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Wed Mar 7 19:03:37 UTC 2018
3、查看当前操作系统发行版信息
cat /etc/issue 或 cat /etc/redhat-release
$ cat /etc/issue
\S
Kernel \r on an \m
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
4、查看cpu相关信息,包括型号、主频、内核信息等
cat /proc/cpuinfo
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
stepping : 7
microcode : 0xffffffff
cpu MHz : 2199.998
cache size : 20480 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm xsaveopt
bogomips : 4399.99
clflush size : 64
cache_alignment : 64
address sizes : 44 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
stepping : 7
microcode : 0xffffffff
cpu MHz : 2199.998
cache size : 20480 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm xsaveopt
bogomips : 4399.99
clflush size : 64
cache_alignment : 64
address sizes : 44 bits physical, 48 bits virtual
power management:
5、列出所有版本信息
lsb_release -a
$ lsb_release -a
-bash: lsb_release: command not found
出现command not found说明没安装lsb_realease,可以执行命令yum install -y redhat-lsb安装lsb_realease,安装完成后,版本信息如下:
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
2. 如何在linux下安装ssl证书
一、创建Azure Key Vault
创建Key Vault和Linux安装SSL之前,大家需要先使用az group create来创建资源。比如创建名为“myResourceGroupSecureWeb”的资源组,需要先复制Azure CLI到对应文件夹中,然后再使用az keyvault create创建Key Vault,并在部署VM时启用该Key Vault。
每一个Key Vault都需要具备唯一的名称,而且全部都是小写字母,然后将名称替换为自己唯一的Key Vault名称,生成证书并存储在Key Vault中。为了让网站SSL安全使用使用,大家需要在Linux安装SSL导入时由受信任的程序提供签名才算是有效证书。
二、准备用于VM的证书
若要在VM创建过程中使用上述证书,大家需要使用az keyvault secret list-versions获取证书的唯一ID,然后再通过az vm format-secret转换该证书。具体操作为创建cloud-init配置以保护NGINX,在首次启动VM时对其进行自定义,再通过cloud-init来安装程序包和写入文件,或者配置用户和安全性。
除了在Linux安装证书初始启动期间要运行cloud-init外,无需在进行其他的步骤和代理。创建VM、安装程序包和启动应用需耗时几分钟。创建后测试一下Web应用是否安全,Linux的ssl证书安装如果使用的是自签名的安全证书,网页会有安全警告,提示用户存在不安全因素。
Linux的ssl证书安装相对于其他系统来讲,比较简单。不过需要注意的是,Linux安装证书对国内和国外的网络环境有一定的设置要求,如果没有及时更改,会造成SSL证书配置失败。