暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

阿里云(Aliyun):云服务器(ECS)

Nephilim 2024-07-17
107

Tips:一些记录,一些笔记



2024/07/17

WEDNESDAY

To be both a speaker of words and a doer of deeds.

既当演说家,又做实干家。




01

阿里云:购买云服务器(ECS)


首先,在阿里云上申请(或购买)云服务器(ECS)


阿里云官方网址:https://www.aliyun.com/


找到「云服务器 ECS」


进入ECS的主页(https://www.aliyun.com/product/ecs),可以看到ECS现在在做活动:

优惠力度还是很大的,上方三种配置方案三选一,售价大概不到原价的十分之一。


选择了你喜欢的配置后,就可以购买了:


如果购买成功,你可以在自己的控制台中,找到你购买的机器:

https://ecs.console.aliyun.com/home


这样,云服务器的资源就准备好了。


02

ECS的基础配置


一、修改登录密码


首先是远程连接ECS的密码口令。


密码口令,可以在下面的界面中找到修改功能:


修改界面如下所示:

我之前已经修改过,这里我就不修改了。



二、远程连接


接下来是「远程连接」


在前面的「实例」界面中,找到「远程连接」,点击后,你会看到如下的界面:


官方提供了以下几种远程连接的方式:

  • Workbench(默认方式)

  • VNC

  • 会话管理

  • 阿里云客户端


(一)Workbench:

可以看到,这时候,就已经可以在页面的命令行终端中进行操作了。


(二)、阿里巴巴客户端(Alibaba Cloud Client)

首先,登录你的阿里云(Profile)

然后,点击「Home」中的「ECS」,就可以看到你的账号中的ECS的资源:

然后,点击后面的「Action」就可以很方便的直接连接到目标的ECS主机了:

然后:

可以看到,已经成功的登录到了ECS的命令行界面中了。


03

Linux「环境检查 巡检」


接下来是对Linux操作系统基础的环境检查(巡检)


Linux系统信息展示:

    [root@iZuf6ft8kvzxhme7svd96pZ ~]# uname -a
    Linux iZuf6ft8kvzxhme7svd96pZ 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
    [root@iZuf6ft8kvzxhme7svd96pZ ~]#


    它打印出来的信息,依次是:

    • 操作系统类型(Operating System Type)

    • 主机名(Hostname)

    • 内核版本(Kernel Version)

    • 操作系统发行版版本号(OS Distribution Version)

    • 操作系统发行版(OS Distribution)

    • 操作系统架构(Architecture)


    操作系统发行版检查:

      [root@iZuf6ft8kvzxhme7svd96pZ ~]# ls -ltr etc/ | grep release
      -rw-r--r-- 1 root root 23 May 21 22:48 system-release-cpe
      -rw-r--r-- 1 root root 51 May 21 22:48 centos-release-upstream
      -rw-r--r-- 1 root root 37 May 21 22:48 centos-release
      drwxr-xr-x 2 root root 4096 Jun 28 12:25 lsb-release.d
      lrwxrwxrwx 1 root root 14 Jun 28 12:29 redhat-release -> centos-release
      lrwxrwxrwx 1 root root 21 Jun 28 12:29 os-release -> ../usr/lib/os-release
      lrwxrwxrwx 1 root root 14 Jun 28 12:29 system-release -> centos-release
      [root@iZuf6ft8kvzxhme7svd96pZ ~]#
      [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat etc/redhat-release
      CentOS Linux release 7.9.2009 (Core)
      [root@iZuf6ft8kvzxhme7svd96pZ ~]#
      [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat etc/os-release
      NAME="CentOS Linux"
      VERSION="7 (Core)"
      ID="centos"
      ID_LIKE="rhel fedora"
      VERSION_ID="7"
      PRETTY_NAME="CentOS Linux 7 (Core)"
      ANSI_COLOR="0;31"
      CPE_NAME="cpe:/o:centos:centos:7"
      HOME_URL="https://www.centos.org/"
      BUG_REPORT_URL="https://bugs.centos.org/"


      CENTOS_MANTISBT_PROJECT="CentOS-7"
      CENTOS_MANTISBT_PROJECT_VERSION="7"
      REDHAT_SUPPORT_PRODUCT="centos"
      REDHAT_SUPPORT_PRODUCT_VERSION="7"


      [root@iZuf6ft8kvzxhme7svd96pZ ~]#
      [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat etc/centos-release
      CentOS Linux release 7.9.2009 (Core)
      [root@iZuf6ft8kvzxhme7svd96pZ ~]#


      「lsb_release」是一个「Linux Standard Base LSB」的工具,用于显示Linux发行版的信息

      它通常用于查询和显示Linux发行版的版本号、发行版代号、描述等信息。

        [root@iZuf6ft8kvzxhme7svd96pZ ~]# whereis lsb_release
        lsb_release: usr/bin/lsb_release usr/share/man/man1/lsb_release.1.gz
        [root@iZuf6ft8kvzxhme7svd96pZ ~]#
        [root@iZuf6ft8kvzxhme7svd96pZ ~]# lsb_release
        LSB Version: :core-4.1-amd64:core-4.1-noarch
        [root@iZuf6ft8kvzxhme7svd96pZ ~]#
        [root@iZuf6ft8kvzxhme7svd96pZ ~]# lsb_release -a
        LSB Version: :core-4.1-amd64:core-4.1-noarch
        Distributor ID: CentOS
        Description: CentOS Linux release 7.9.2009 (Core)
        Release: 7.9.2009
        Codename: Core
        [root@iZuf6ft8kvzxhme7svd96pZ ~]#


        通过「hostnamectl」查询Linux系统信息

        「hostnamectl」是一个用于管理系统主机名(hostname)的命令行工具。

        它通常在Linux系统中提供,用来查询、设置和管理系统的主机名及其相关的信息。

          [root@iZuf6ft8kvzxhme7svd96pZ ~]# whereis hostnamectl
          hostnamectl: /usr/bin/hostnamectl usr/share/man/man1/hostnamectl.1.gz
          [root@iZuf6ft8kvzxhme7svd96pZ ~]#
          [root@iZuf6ft8kvzxhme7svd96pZ ~]# hostnamectl
          Static hostname: iZuf6ft8kvzxhme7svd96pZ
          Icon name: computer-vm
          Chassis: vm
          Machine ID: 88b247814be64fbf8fa045566b89ce3e
          Boot ID: f7f682ca743140fda4a323b4db152112
          Virtualization: kvm
          Operating System: CentOS Linux 7 (Core)
          CPE OS Name: cpe:/o:centos:centos:7
          Kernel: Linux 3.10.0-1160.119.1.el7.x86_64
          Architecture: x86-64
          [root@iZuf6ft8kvzxhme7svd96pZ ~]#


          显示系统运行时间、负载情况

            [root@iZuf6ft8kvzxhme7svd96pZ ~]# whereis uptime
            uptime: usr/bin/uptime usr/share/man/man1/uptime.1.gz
            [root@iZuf6ft8kvzxhme7svd96pZ ~]#
            [root@iZuf6ft8kvzxhme7svd96pZ ~]# uptime
            16:47:59 up 1:38, 1 user, load average: 0.00, 0.01, 0.05
            [root@iZuf6ft8kvzxhme7svd96pZ ~]#


            反馈信息的意义依次如下所示:

            • 当前时间:显示当前系统时间

            • 系统运行时间:显示系统自上次启动以来的运行时间,通常以天、时、分的格式显示

            • 当前用户数:当前登录系统的用户个数

            • 平均负载(load average):显示系统在过去1分钟、5分钟、15分钟内的平均负载;负载指的是系统处于运行和等待状态的进程数的平均值


            查看系统负载:

              [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat proc/loadavg 
              0.00 0.03 0.05 1/157 12231
              [root@iZuf6ft8kvzxhme7svd96pZ ~]#


              内存使用:

                [root@iZuf6ft8kvzxhme7svd96pZ ~]# free -h
                total used free shared buff/cache available
                Mem: 1.7G 132M 877M 512K 746M 1.4G
                Swap: 0B 0B 0B
                [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                获得内存总量与空闲内存量:

                  [root@iZuf6ft8kvzxhme7svd96pZ ~]# grep MemTotal proc/meminfo 
                  MemTotal: 1798504 kB
                  [root@iZuf6ft8kvzxhme7svd96pZ ~]#
                  [root@iZuf6ft8kvzxhme7svd96pZ ~]# grep MemFree proc/meminfo
                  MemFree: 893728 kB
                  [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                  列出已经加载的内核模块:

                    [root@iZuf6ft8kvzxhme7svd96pZ ~]# lsmod
                    Module Size Used by
                    nfit 59735 0
                    libnvdimm 163620 1 nfit
                    iosf_mbi 15582 0
                    crc32_pclmul 13133 0
                    sunrpc 366617 1
                    ghash_clmulni_intel 13273 0
                    ppdev 17671 0
                    aesni_intel 189456 0
                    lrw 13286 1 aesni_intel
                    gf128mul 15139 1 lrw
                    glue_helper 13990 1 aesni_intel
                    ablk_helper 13597 1 aesni_intel
                    cryptd 21190 3 ghash_clmulni_intel,aesni_intel,ablk_helper
                    joydev 17389 0
                    parport_pc 28205 0
                    virtio_balloon 18015 0
                    pcspkr 12718 0
                    parport 46395 2 ppdev,parport_pc
                    i2c_piix4 22401 0
                    ip_tables 27126 0
                    ext4 592325 1
                    mbcache 14958 1 ext4
                    jbd2 107486 1 ext4
                    ata_generic 12923 0
                    pata_acpi 13053 0
                    cirrus 24171 1
                    virtio_net 27994 0
                    net_failover 18147 1 virtio_net
                    drm_kms_helper 186531 1 cirrus
                    virtio_blk 18472 2
                    virtio_console 28076 1
                    failover 13374 1 net_failover
                    syscopyarea 12529 1 drm_kms_helper
                    sysfillrect 12701 1 drm_kms_helper
                    sysimgblt 12640 1 drm_kms_helper
                    fb_sys_fops 12703 1 drm_kms_helper
                    ttm 100769 1 cirrus
                    drm 468454 4 ttm,drm_kms_helper,cirrus
                    ata_piix 35052 0
                    libata 247190 3 pata_acpi,ata_generic,ata_piix
                    crct10dif_pclmul 14307 0
                    crct10dif_common 12595 1 crct10dif_pclmul
                    crc32c_intel 22094 0
                    floppy 73520 0
                    serio_raw 13434 0
                    virtio_pci 22985 0
                    virtio_ring 22991 5 virtio_blk,virtio_net,virtio_pci,virtio_balloon,virtio_console
                    virtio 14959 5 virtio_blk,virtio_net,virtio_pci,virtio_balloon,virtio_console
                    drm_panel_orientation_quirks 17180 1 drm
                    [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                    查看CPU状态:

                      [root@iZuf6ft8kvzxhme7svd96pZ ~]# lscpu 
                      Architecture: x86_64
                      CPU op-mode(s): 32-bit, 64-bit
                      Byte Order: Little Endian
                      CPU(s): 2
                      On-line CPU(s) list: 0,1
                      Thread(s) per core: 2
                      Core(s) per socket: 1
                      Socket(s): 1
                      NUMA node(s): 1
                      Vendor ID: GenuineIntel
                      CPU family: 6
                      Model: 85
                      Model name: Intel(R) Xeon(R) Platinum
                      Stepping: 4
                      CPU MHz: 2499.998
                      BogoMIPS: 4999.99
                      Hypervisor vendor: KVM
                      Virtualization type: full
                      L1d cache: 32K
                      L1i cache: 32K
                      L2 cache: 1024K
                      L3 cache: 33792K
                      NUMA node0 CPU(s): 0,1
                      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 nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single rsb_ctxsw fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat
                      [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                      也可以通过「/proc/cpuinfo」获得CPU的状态信息:

                        [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat proc/cpuinfo 
                        processor : 0
                        vendor_id : GenuineIntel
                        cpu family : 6
                        model : 85
                        model name : Intel(R) Xeon(R) Platinum
                        stepping : 4
                        microcode : 0x1
                        cpu MHz : 2499.998
                        cache size : 33792 KB
                        physical id : 0
                        siblings : 2
                        core id : 0
                        cpu cores : 1
                        apicid : 0
                        initial apicid : 0
                        fpu : yes
                        fpu_exception : yes
                        cpuid level : 22
                        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 nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single rsb_ctxsw fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat
                        bogomips : 4999.99
                        clflush size : 64
                        cache_alignment : 64
                        address sizes : 46 bits physical, 48 bits virtual
                        power management:


                        processor : 1
                        vendor_id : GenuineIntel
                        cpu family : 6
                        model : 85
                        model name : Intel(R) Xeon(R) Platinum
                        stepping : 4
                        microcode : 0x1
                        cpu MHz : 2499.998
                        cache size : 33792 KB
                        physical id : 0
                        siblings : 2
                        core id : 0
                        cpu cores : 1
                        apicid : 1
                        initial apicid : 1
                        fpu : yes
                        fpu_exception : yes
                        cpuid level : 22
                        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 nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single rsb_ctxsw fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat
                        bogomips : 4999.99
                        clflush size : 64
                        cache_alignment : 64
                        address sizes : 46 bits physical, 48 bits virtual
                        power management:


                        [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                        磁盘挂载:

                          [root@iZuf6ft8kvzxhme7svd96pZ ~]# df -h
                          Filesystem Size Used Avail Use% Mounted on
                          devtmpfs 868M 0 868M 0% dev
                          tmpfs 879M 0 879M 0% dev/shm
                          tmpfs 879M 512K 878M 1% run
                          tmpfs 879M 0 879M 0% sys/fs/cgroup
                          /dev/vda1 40G 2.5G 35G 7%
                          tmpfs 176M 0 176M 0% run/user/0
                          [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                          网卡:

                            [root@iZuf6ft8kvzxhme7svd96pZ ~]# ifconfig
                            eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
                            inet 172.90.169.140 netmask 255.255.240.0 broadcast 172.20.143.255
                            inet6 fe80::216:3eff:fe3f:1299 prefixlen 64 scopeid 0x20<link>
                            ether 00:16:3e:3f:12:99 txqueuelen 1000 (Ethernet)
                            RX packets 77025 bytes 106254434 (101.3 MiB)
                            RX errors 0 dropped 0 overruns 0 frame 0
                            TX packets 13369 bytes 1625575 (1.5 MiB)
                            TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


                            lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
                            inet 127.0.0.1 netmask 255.0.0.0
                            inet6 ::1 prefixlen 128 scopeid 0x10<host>
                            loop txqueuelen 1000 (Local Loopback)
                            RX packets 112 bytes 9038 (8.8 KiB)
                            RX errors 0 dropped 0 overruns 0 frame 0
                            TX packets 112 bytes 9038 (8.8 KiB)
                            TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


                            [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                            路由:

                              [root@iZuf6ft8kvzxhme7svd96pZ ~]# route -n
                              Kernel IP routing table
                              Destination Gateway Genmask Flags Metric Ref Use Iface
                              0.0.0.0 172.20.143.253 0.0.0.0 UG 0 0 0 eth0
                              169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
                              172.20.128.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
                              [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                              网络统计信息:

                                [root@iZuf6ft8kvzxhme7svd96pZ ~]# netstat -s
                                Ip:
                                15937 total packets received
                                0 forwarded
                                0 incoming packets discarded
                                15933 incoming packets delivered
                                14118 requests sent out
                                1 dropped because of missing route
                                Icmp:
                                62 ICMP messages received
                                0 input ICMP message failed.
                                ICMP input histogram:
                                destination unreachable: 56
                                echo requests: 4
                                echo replies: 2
                                67 ICMP messages sent
                                0 ICMP messages failed
                                ICMP output histogram:
                                destination unreachable: 61
                                echo request: 2
                                echo replies: 4
                                IcmpMsg:
                                InType0: 2
                                InType3: 56
                                InType8: 4
                                OutType0: 4
                                OutType3: 61
                                OutType8: 2
                                Tcp:
                                352 active connections openings
                                38 passive connection openings
                                15 failed connection attempts
                                1 connection resets received
                                2 connections established
                                15006 segments received
                                13302 segments send out
                                31 segments retransmited
                                0 bad segments received.
                                26 resets sent
                                Udp:
                                797 packets received
                                61 packets to unknown port received.
                                0 packet receive errors
                                906 packets sent
                                0 receive buffer errors
                                0 send buffer errors
                                UdpLite:
                                TcpExt:
                                16 invalid SYN cookies received
                                15 resets received for embryonic SYN_RECV sockets
                                49 packets pruned from receive queue because of socket buffer overrun
                                343 TCP sockets finished time wait in fast timer
                                804 delayed acks sent
                                1 delayed acks further delayed because of locked socket
                                Quick ack mode was activated 8 times
                                7 packets directly queued to recvmsg prequeue.
                                3 bytes directly received in process context from prequeue
                                8446 packet headers predicted
                                1663 acknowledgments not containing data payload received
                                1181 predicted acknowledgments
                                2 timeouts in loss state
                                2 retransmits in slow start
                                9 other TCP timeouts
                                TCPLossProbes: 5
                                TCPLossProbeRecovery: 1
                                552 packets collapsed in receive queue due to low socket buffer
                                9 DSACKs sent for old packets
                                3 DSACKs received
                                1 connections reset due to early user close
                                1 connections aborted due to timeout
                                TCPDSACKIgnoredNoUndo: 3
                                TCPRcvCoalesce: 1755
                                TCPOFOQueue: 44
                                TCPWantZeroWindowAdv: 6
                                TCPSynRetrans: 12
                                TCPOrigDataSent: 3566
                                IpExt:
                                InNoRoutes: 4
                                InOctets: 102826007
                                OutOctets: 1654678
                                InNoECTPkts: 77816
                                [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                                YUM:配置

                                  [root@iZuf6ft8kvzxhme7svd96pZ ~]# ls -ltr /etc/ | grep yum
                                  -rw-r--r--. 1 root root 970 Oct 2 2020 yum.conf
                                  drwxr-xr-x. 6 root root 4096 Jun 28 12:17 yum
                                  drwxr-xr-x. 2 root root 4096 Jun 28 12:38 yum.repos.d
                                  [root@iZuf6ft8kvzxhme7svd96pZ ~]#
                                  [root@iZuf6ft8kvzxhme7svd96pZ ~]# cat /etc/yum.conf
                                  [main]
                                  cachedir=/var/cache/yum/$basearch/$releasever
                                  keepcache=0
                                  debuglevel=2
                                  logfile=/var/log/yum.log
                                  exactarch=1
                                  obsoletes=1
                                  gpgcheck=1
                                  plugins=1
                                  installonly_limit=5
                                  bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
                                  distroverpkg=centos-release




                                  # This is the default, if you make this bigger yum won't see if the metadata
                                  # is newer on the remote and so you'll "gain" the bandwidth of not having to
                                  # download the new metadata and "pay" for it by yum not having correct
                                  # information.
                                  # It is esp. important, to have correct metadata, for distributions like
                                  # Fedora which don't keep old packages around. If you don't like this checking
                                  # interupting your command line usage, it's much better to have something
                                  # manually check the metadata once an hour (yum-updatesd will do this).
                                  # metadata_expire=90m


                                  # PUT YOUR REPOS HERE OR IN separate files named file.repo
                                  # in /etc/yum.repos.d
                                  [root@iZuf6ft8kvzxhme7svd96pZ ~]#
                                  [root@iZuf6ft8kvzxhme7svd96pZ ~]# cd /etc/yum.repos.d/
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]# ls -ltr
                                  total 8
                                  -rw-r--r-- 1 root root 675 Jul 17 15:09 CentOS-Base.repo
                                  -rw-r--r-- 1 root root 230 Jul 17 15:09 epel.repo
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]#
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]# cat /etc/yum.repos.d/CentOS-Base.repo
                                  [base]
                                  name=CentOS-$releasever
                                  enabled=1
                                  failovermethod=priority
                                  baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
                                  gpgcheck=1
                                  gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7


                                  [updates]
                                  name=CentOS-$releasever
                                  enabled=1
                                  failovermethod=priority
                                  baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
                                  gpgcheck=1
                                  gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7


                                  [extras]
                                  name=CentOS-$releasever
                                  enabled=1
                                  failovermethod=priority
                                  baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
                                  gpgcheck=1
                                  gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]#
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]# cat /etc/yum.repos.d/epel.repo
                                  [epel]
                                  name=Extra Packages for Enterprise Linux 7 - $basearch
                                  enabled=1
                                  failovermethod=priority
                                  baseurl=http://mirrors.cloud.aliyuncs.com/epel/7/$basearch
                                  gpgcheck=0
                                  gpgkey=http://mirrors.cloud.aliyuncs.com/epel/RPM-GPG-KEY-EPEL-7
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]#
                                  [root@iZuf6ft8kvzxhme7svd96pZ yum.repos.d]#


                                  YUM:仓库状态

                                    [root@iZuf6ft8kvzxhme7svd96pZ ~]# yum repolist
                                    Loaded plugins: fastestmirror
                                    Loading mirror speeds from cached hostfile
                                    repo id repo name status
                                    base/7/x86_64 CentOS-7 10,072
                                    epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,791
                                    extras/7/x86_64 CentOS-7 526
                                    updates/7/x86_64 CentOS-7 6,173
                                    repolist: 30,562
                                    [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                                    获得所有PCI设备:

                                      [root@iZuf6ft8kvzxhme7svd96pZ ~]# lspci -tv
                                      -[0000:00]-+-00.0 Intel Corporation 440FX - 82441FX PMC [Natoma]
                                      +-01.0 Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
                                      +-01.1 Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
                                      +-01.2 Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II]
                                      +-01.3 Intel Corporation 82371AB/EB/MB PIIX4 ACPI
                                      +-02.0 Cirrus Logic GD 5446
                                      +-03.0 Red Hat, Inc. Virtio console
                                      +-04.0 Red Hat, Inc. Virtio block device
                                      +-05.0 Red Hat, Inc. Virtio network device
                                      \-06.0 Red Hat, Inc. Virtio memory balloon
                                      [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                                      获得所有环境变量:

                                        [root@iZuf6ft8kvzxhme7svd96pZ ~]# env
                                        XDG_SESSION_ID=39
                                        HOSTNAME=iZuf6ft8kvzxhme7svd96pZ
                                        TERM=xterm-256color
                                        SHELL=/bin/bash
                                        HISTSIZE=1000
                                        SSH_CLIENT=117.136.46.68 63449 22
                                        SSH_TTY=/dev/pts/1
                                        USER=root
                                        LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
                                        MAIL=/var/spool/mail/root
                                        PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
                                        PWD=/root
                                        LANG=en_US.UTF-8
                                        HISTCONTROL=ignoredups
                                        SHLVL=1
                                        HOME=/root
                                        LOGNAME=root
                                        SSH_CONNECTION=117.136.46.68 63449 172.20.139.110 22
                                        LESSOPEN=||/usr/bin/lesspipe.sh %s
                                        XDG_RUNTIME_DIR=/run/user/0
                                        _=/usr/bin/env
                                        OLDPWD=/etc/yum.repos.d
                                        [root@iZuf6ft8kvzxhme7svd96pZ ~]#


                                        查看所有磁盘:

                                          [root@iZuf6ft8kvzxhme7svd96pZ ~]# fdisk -l


                                          Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
                                          Units = sectors of 1 * 512 = 512 bytes
                                          Sector size (logical/physical): 512 bytes / 512 bytes
                                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                                          Disk label type: dos
                                          Disk identifier: 0x000edc45


                                          Device Boot Start End Blocks Id System
                                          /dev/vda1 * 2048 83886046 41941999+ 83 Linux
                                          [root@iZuf6ft8kvzxhme7svd96pZ ~]#





                                          END




                                          温馨提示



                                          如果你喜欢本文,请分享到朋友圈,想要获得更多信息,请关注我。


                                          文章转载自Nephilim,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

                                          评论