hgxfg9

人生若只如初见,何事秋风悲画扇。

0%

EMC DS-300B、DS-5100B、DS-5300B系列交换机恢复密码

请按照以下步骤操作:

注意:这将恢复所有密码并将其重置为默认值,以恢复管理员和用户密码以 root 身份登录并检查命令指南以获取正确的命令。

在尝试恢复密码之前,可以使用初始密码进行测试,如果初始密码无法进入系统,再尝试使用重置方式恢复密码

用户名 密码
root fibranne
factory fibranne
admin password
user password
密码重置方案

1、使用Console连接到设备上带有“I0I0I”标志的端口。默认波特率为9600

2、重启交换机

3、当提示 Hit ESC to stop autoboot时按下ESC键,当按下ESC键后 Boot PROM 菜单会显示以下选项:

1
2
3
4
5
6
7
Hit ESC to stop autoboot:  0  	#按下ESC

1) Start system.
2) Recover password.
3) Enter command shell.

Option? #输入3进入命令行界面

4、输入3打开命令行界面

5、如果设置过Boot PROM密码则会提示输入密码

6、使用命令printenv可以看到当前环境选项

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
=> printenv
AutoLoad=yes
BootromVerbose=no
InitTest=MEM()
LoadIdentifiers=Fabric Operating System;Fabric Operating System
OSLoadOptions=quiet #当前OSLoadOptions为quiet模式
OSLoader=ATA()0x5c0f7;ATA()0x1818b0
OSRootPartition=hda1;hda2
SkipWatchdog=yes
baudrate=9600
bootcmd=setenv bootargs mem=${mem} ${OSLoadOptions};ataboot;bootm 0x400000
bootdelay=20
ethact=ppc_4xx_eth0
ethaddr=00:05:33:6C:E2:5B
hostname=sequoia
initrd_high=0x20000000
mem=520192k
preboot=echo;echo Type "run flash_nfs" to mount root filesystem over NFS;echo
netdev=eth0
consoledev=ttyS1
ramdiskaddr=400000
ramdiskfile=your.ramdisk.u-boot
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 1.1.3 (Feb 23 2010 - 09:41:55)

Environment size: 729/4080 bytes

输入命令setenv OSLoadOptions "single"以更改 OSLoadOptions 设置,以便交换机将启动到单用户模式

1
=> setenv OSLoadOptions "single"

7、再次输入printenv,验证修改是否成功

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
=> printenv
AutoLoad=yes
BootromVerbose=no
InitTest=MEM()
LoadIdentifiers=Fabric Operating System;Fabric Operating System
OSLoadOptions=single #已经修改成功
OSLoader=ATA()0x5c0f7;ATA()0x1818b0
OSRootPartition=hda1;hda2
SkipWatchdog=yes
baudrate=9600
bootcmd=setenv bootargs mem=${mem} ${OSLoadOptions};ataboot;bootm 0x400000
bootdelay=20
ethact=ppc_4xx_eth0
ethaddr=00:05:33:6C:E2:5B
hostname=sequoia
initrd_high=0x20000000
mem=520192k
preboot=echo;echo Type "run flash_nfs" to mount root filesystem over NFS;echo
netdev=eth0
consoledev=ttyS1
ramdiskaddr=400000
ramdiskfile=your.ramdisk.u-boot
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 1.1.3 (Feb 23 2010 - 09:41:55)

Environment size: 730/4080 bytes

8、输入命令saveenv保存更改

1
2
3
4
5
6
7
=> saveenv
Saving Environment to Flash...

. done

. done
done

9、输入boot,以单用户模式启动设备

1
2
3
4
5
6
7
8
=> boot
Map file at LBA sector 0x5c0f7
## Booting image at 00400000 ...
Image Name: Linux-2.6.14.2
Image Type: PowerPC Linux Multi-File Image (uncompressed)
Data Size: 4290075 Bytes = 4.1 MB
Load Address: 00000000
[output truncated]

10、输入命令mount -o remount,rw /重新挂载根分区,使其能够进行读/写操作

1
2
3
4
sh-2.04# 
sh-2.04# mount -o remount,rw /
EXT3 FS on hda1, internal journal #返回值为hda1
sh-2.04#

11、使用mount命令挂载二级分区,如果上一步返回的值为hda1,则这步挂载hda2;如果上一步返回hda2则这步挂载hda1

1
2
3
4
5
sh-2.04# mount /dev/hda2 /mnt
kjournald starting. Commit interval 5 seconds
EXT3 FS on hda2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.

12、输入命令/sbin/passwddefault将所有密码重置为默认值

1
2
3
sh-2.04# /sbin/passwddefault
passwdCfg: fabosInit failed with -1
All account passwords have been successfully set to factory default.

在某些平台上,通过 bootprom 尝试密码恢复期间的此步骤可能会显示错误消息,例如:
Raslog Module Initialization failed rc=-1
fabsys device open: No such device or address.
只要响应此命令出现消息 All account passwords have been successfully set to factory default 就可以忽略这些消息。

13、输入命令 bootenv OSLoadOptions "quiet;quiet"OSLoadOptions 重置为 quiet;quiet (双引号不可删除,必须加上)

1
sh-2.04# bootenv OSLoadOptions "quiet;quiet"

14、输入reboot -f重启交换机

1
2
3
4
5
sh-2.04# reboot -f
Restarting system.
.

The system is coming up, please wait...

15、使用默认密码admin/password登录交换机

Borcade SAN Switch常见操作

概述

No.1: 简介

  1. Storage Area Network
    存储区域网络,简称SAN。随着iSCSI技术的推广,现在的SAN架构分为FC SAN和IP SAN,但是目前在提到SAN一般都在FC SAN,这里我们也只讨论FC SAN。

No.2: 端口

光纤通道也定义了其他一系列不同类别可以用于接收和传输光纤通道数据的端口, 如下

  1. 设备 (节点)端口
    N_Port = Fabric直接连接设备
    NL_Port = Loop连接设备
  2. 交换机端口
    E_Port = 扩展端口 (Switch级联)
    F_Port = Fabric端口
    FL_Port = Fabric Loop端口
    G_Port = 通用(Generic)端口,可以转化为E或F

Brocade SAN Switch日常维护

No.1: 信息查询(巡检)

  1. IP信息查询:ipaddrshow

    1
    2
    3
    4
    5
    6
    7
    8
    san1:admin> ipaddrshow

    SWITCH
    Ethernet IP Address: 10.172.28.6
    Ethernet Subnetmask: 255.255.255.0
    Fibre Channel IP Address: 0.0.0.0
    Fibre Channel Subnetmask: 0.0.0.0
    Gateway Address: 10.172.28.1COPY
  2. 查看交换机信息及所有端口状态:switchshow

    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
    san1:admin> switchshow
    switchName: moonpac
    switchType: 34.0
    switchState: Online
    switchMode: Native
    switchRole: Principal
    switchDomain: 1
    switchId: fffc01
    switchWwn: 10:00:00:05:1e:02:22:f1
    zoning: ON (cfg0)
    switchBeacon: OFF

    Area Port Media Speed State
    ==============================
    0 0 id N2 Online F-Port 20:24:00:a0:b8:26:11:a6
    1 1 id N2 Online F-Port 20:25:00:a0:b8:26:11:a6
    2 2 id N2 Online F-Port 10:00:00:90:fa:ca:87:02
    3 3 id N2 Online F-Port 10:00:00:90:fa:ca:87:03
    4 4 id N2 No_Light
    5 5 id N2 No_Light
    6 6 id N2 No_Light
    7 7 id N2 No_Light
    8 8 -- N4 No_Module (No POD License) Disabled
    9 9 -- N4 No_Module (No POD License) Disabled
    10 10 -- N4 No_Module (No POD License) Disabled
    11 11 -- N4 No_Module (No POD License) Disabled
    12 12 -- N4 No_Module (No POD License) Disabled
    13 13 -- N4 No_Module (No POD License) Disabled
    14 14 -- N4 No_Module (No POD License) Disabled
    15 15 -- N4 No_Module (No POD License) DisabledCOPY
  3. 查看交换机运行状态: switchstatusshow
    交换机状态为healthy,则表示交换机当前运行正常,如果有不是healthy的状态出现,则需要根据具体问题使用相关命令继续检查.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    san1:admin> switchstatusshow
    Switch Health Report Report time: 01/01/2000 08:35:11 PM
    Switch Name: moonpac
    IP address: 10.172.28.6
    SwitchState: HEALTHY
    Duration: 20:33

    Power supplies monitor HEALTHY
    Temperatures monitor HEALTHY
    Fans monitor HEALTHY
    Flash monitor HEALTHY
    Marginal ports monitor HEALTHY
    Faulty ports monitor HEALTHY
    Missing SFPs monitor HEALTHY
    Fabric Watch is not licensed
    Detailed port information is not includedCOPY
  4. 风扇运行状态: fanshow

    1
    2
    3
    4
    san1:admin> fanshow
    Fan 1 is Ok
    Fan 2 is Ok
    Fan 3 is OkCOPY
  5. 当前温度查询: tempshow
    显示交换机当前温度信息,并检查当前交换机的温度传感器是否为OK状态

    1
    2
    3
    4
    5
    6
    san1:admin> tempshow
    Sensor State Centigrade Fahrenheit
    ID
    ==============================================
    1 Ok 29 84
    2 Ok 29 84COPY
  6. 电源运行状态: psshow
    电源状态都是OK则表明电源运行正常,absent表示没有插电源。

    1
    2
    3
    san1:admin> psshow

    Power Supply #1 is OKCOPY
  7. 错误日志: errdump

  8. Firmware版本信息: firmwareshow

    1
    2
    3
    san1:admin> firmwareshow
    Primary partition: v5.0.1b
    Secondary Partition: v5.0.1bCOPY
  9. 显示交换机的工作时间: uptime
    检查该交换机当前时钟,目前有几个用户登录到这台交换机,以及它已经正常工作了多长时间等信息。

    1
    2
    san1:admin> uptime
    5:42am up 3:25, 1 user, load average: 0.00, 0.00, 0.00COPY
  10. License信息查询: licenseshow

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    san1:admin> licenseshow
    cbSRRSzcddcTSSp:
    Web license
    RdybRccSdySezcSU:
    Zoning license
    //换一台看看
    san2:admin> licenseshow
    cSzbbcdyQbdT0ccn:
    Obsolete license
    RRS9cQ9zR9SSTAdN:
    Obsolete license
    SQczdycQRSTRd0eA:
    Fabric license //级联License
    b9bcR9bdbRcAcdSG:
    Extended Fabric license //增加信号许可,两级联设备距离超过10KM,两端交换机都需要购买
    bRybdQd9Sbcazceu:
    Enhanced Frame Redirection license
    Remote Fabric license
    High-Performance Extension over FCIP/FC license
    COPY
  11. zone的配置信息查询: cfgshow

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1; dsb_fc2
    zone: dsa_fc1 dsa; fc1
    zone: dsa_fc2 dsa; fc2
    zone: dsb_fc1 dsb; fc1
    zone: dsb_fc2 dsb; fc2
    alias: dsa 1,0
    alias: dsb 1,1
    alias: fc1 1,2
    alias: fc2 1,3

    Effective configuration:
    cfg: cfg0
    zone: dsa_fc1 1,0
    1,2
    zone: dsa_fc2 1,0
    1,3
    zone: dsb_fc1 1,1
    1,2
    zone: dsb_fc2 1,1
    1,3COPY

No.2: 维护操作

  1. IP设置: ipaddrset

    1
    2
    3
    4
    5
    6
    7
    8
    9
    san1:admin> ipaddrset
    Ethernet IP Address [10.172.28.6]: 10.172.28.8
    Ethernet Subnetmask [255.255.255.0]:
    Fibre Channel IP Address [0.0.0.0]:
    Fibre Channel Subnetmask [0.0.0.0]:
    Gateway IP Address [10.172.28.1]:
    Issuing gratuitous ARP...Done.
    IP address is being changed...Done.
    Committing configuration...Done.COPY
  2. 自定义交换机名称:switchname newname

    1
    2
    3
    4
    san1:admin> switchname moonpac
    Committing configuration...
    Done.
    san1:admin> COPY
  3. 导入许可信息: licenseadd "license-key"

  4. 配置备份: configupload

    • 配置文件备份的作用: 

    • 灾难恢复 

    • 故障诊断及恢复 

    • 恢复一台无效配置的交换机 

    • 修改或者扩展SAN 

    • 恢复意外删除的许可 

    • 恢复或者重配分区配置

    • 需求: 有一台FTP Server.

      1
      2
      3
      4
      5
      6
      7
      san1:admin> configupload
      Protocol (scp or ftp) [ftp]: ftp
      Server Name or IP Address [host]: 10.172.28.103
      User Name [user]: dream
      File Name [config.txt]: ds4700_cfg.txt
      Password:
      Upload completeCOPY
  5. 配置恢复: configdownload
    先要关闭交换机: switchdisable

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    san1:admin> configdownload 
    configDownload: This command may not be executed on an operational switch.
    You must first disable the switch using the "switchDisable" command.
    san1:admin> switchdisable
    san1:admin> configdownload
    Protocol (scp or ftp) [ftp]: ftp
    Server Name or IP Address [host]: 10.172.28.103
    User Name [user]: dream
    File Name [config.txt]: ds4700_cfg.txt
    Password:

    *** CAUTION ***

    This command is used to download a backed-up configuration
    for a specific switch. If using a file from a different
    switch, this file's configuration settings will override
    any current switch settings. Downloading a configuration
    file, which was uploaded from a different type of switch,
    may cause this switch to fail. A switch reboot might be
    required for some parameter changes to take effect.

    Do you want to continue [y/n]: y
    download completed.COPY
  6. 修改用户密码: passwd [username]
    不加username时修改当前用户的密码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    san1:admin> passwd
    Changing password for admin
    Enter old password:
    Enter new password:
    Password must be between 8 and 40 characters long.
    Enter new password:
    Re-type new password:
    passwd: all authentication tokens updated successfully
    Saving password to stable storage.
    Password saved to stable storage successfully.

SAN Switch关开机

这是我从一次项目中摘出来的,只能算是一个流程吧

No.1: 关机

  1. 确保所有的主机存储都已关闭.
  2. 登录SAN交换机收集信息
    • 端口信息:switchshow
    • zoning配置信息:cfgshow,zoneshow
    • Licenses信息:licenseshow
  3. 备份配置
  4. 关机:sysshutdown

No.2: 开机

  1. 建议所有的设备SAN Switch最先启动
  2. 检查交换机的级联状态是否正常:
    • 看端口信息:switchshow 级联的端口显示为E-Port
    • 查看交换机的数量:fabricshow 可以看到两台,domain ID不同
  3. 查看zoning配置是否正确
    • 主机存储开启后看LUN映射是否成功
    • cfgshowzoneshow查看并与关机前的收集的信息核对

No.3: 回退方案

  1. 级联失败

    • 检查级联端口FC模块是否良好

    • 检查级联的光纤线是否良好

    • 级联License是否丢失(我觉得不大可能哈)

    • 导入级联license:licenseadd xxxxxxxxx

    • 修改switch domain ID

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      san1:admin> switchdisable
      san1c:admin> configure
      Configure...
      Fabric parameters (yes, y, no, n): [no] yes

      Domain: (1..239) [1] 2 //这里修改
      R_A_TOV: (4000..120000) [10000]
      E_D_TOV: (1000..5000) [2000]
      WAN_TOV: (0..30000) [0]
      MAX_HOPS: (7..19) [7]
      ......COPY
    • 在要做级联的端口连线,在端口指示灯正常后登录交换机查看级联是否成功

  2. zoning配置损坏

    • 从备份恢复
    • 手动重新配置

SAN Switch高级配置

No.1: 忘记密码时恢复默认密码

恢复密码的大概过程是:
1. 重启San Switch。
2. 重启的时候可以注意到有一个提示,4秒内按esc可以中断启动, 进入启动接口模式。
3. 按3 进入到command shell 模式,手动启动系统到单用户模式。
4. 恢复密码并重启san switch。

  1. 串口链接SAN Switch并重启
    moonpac:admin> reboot

  2. 在交换机启动到Press escape within 4 seconds to enter boot interface时在4秒内按Esc进入Boot PROM菜单,一共有3 个选项:

    1
    2
    3
    4
    5
    6
    7
    Press escape within 4 seconds to enter boot interface.

    1) Start system. //启动系统
    2) Recover password. //生成支持提供商的字符串,以恢复Boot PROM密码;需要有"Recovery"密码,仅原厂限内部使用;
    3) Enter command shell. //打开一个可以输入命令的shell

    Option? 3COPY
  3. 输入3进入到command shell模式,通过配置以单用户模式启动设备(其实就是一个嵌入式Linux)

    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
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    ......
    Option? 3
    Password: //输入Boot PROM密码,如果没有设置,则会提示"Boot PROM password has not been set",这个密码可以在"command shell"中设置
    > help //帮助
    Valid commands are:
    auto Boot per boot environment variable settings
    boot Boot specified image
    date Display or set the system date and time
    debug Hardware debug - General debug utilities
    diag Hardware tests - Hardware test diagnostics
    help Display this list of commands
    helpenv Display help for boot environment variables
    hinv Display hardware inventory
    passwd Set the boot modification password
    ping Ping test
    printenv Display all boot environment variables
    reset Reset the system
    resetpw Remove the boot modification password
    setenv Set a boot environment variable
    saveenv Save the current boot environment variables
    unsetenv Unset a boot environment variable
    version Display boot version info
    > passwd //修改Boot PROM密码,这个与恢复系统密码无关.
    Old password:
    New password:
    Re-enter new password:
    > saveenv //保存当前的引导环境变量,不保存重启失效.
    > resetpw //删除Boot PROM密码,这个与恢复系统密码无关.
    > saveenv
    > printenv //显示所有引导环境变量,目的是查看switch的系统OSLoader值为多少
    AutoLoad=yes
    ENET_MAC=00051E0222F1
    InitTest=MEM()
    LoadIdentifiers=Fabric Operating System;Fabric Operating System
    OSLoadOptions=quiet;quiet
    OSLoader=ATA()0x10b10;ATA()0x55000 //OS的加载程序(可启动DEVICE),可以看出有两个系统
    OSRootPartition=hda1;hda2 //OS的"/"分区,也有两个
    SkipWatchdog=yes
    > boot ATA()0x10b10 -s //格式为:"boot DEVICE [COMMAND_LINE]":DEVICE一般为OSLoader的第一个值;COMMAND_LINE可以把"-s"更换为"single",与Linux(grub 1.x)何其相似啊
    Booting "Manually selected OS" image.
    Entry point at 0x01000000 ...
    开机自检过程省略......
    INIT: version 2.78 booting
    sh-2.04# //已进入单用户模式
    sh-2.04#COPY
    • 启动单用户还有一种设置,原理是一样的,可我做实验失败了,但我同事却在一家客户那边做过,可能版本不同采用的方法不同(猜测哈),就当做个记录,上面的方法不成功是可以试试这个.

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      ......
      Option? 3
      Boot PROM password has not been set.
      > setenv OSLoadOptions=single
      > printenv
      Unrecognized command "printenv".
      "help" will give a list of commands.
      > printenv
      AutoLoad=yes
      ENET_MAC=00051E0222F1
      InitTest=MEM()
      LoadIdentifiers=Fabric Operating System;Fabric Operating System
      OSLoadOptions=single //表示交换机将引导到单用户模式
      OSLoader=ATA()0x10b10;ATA()0x55000
      OSRootPartition=hda1;hda2
      SkipWatchdog=yes
      > saveenv //保存,否则不生效
      > boot
      ......
      > bootenv OSLoadOptions "quiet;quiet" //将OSLoadOptions重置为“quiet; quiet”
      > reboot -fCOPY
  4. 恢复密码并重启SAN Switch

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    sh-2.04#
    sh-2.04# mount -o remount,rw,noatime / //挂载以下/分区,否则的话没有恢复密码的权限
    EXT3 FS on hda1, internal journal
    sh-2.04#
    sh-2.04#
    sh-2.04# mount /dev/hda2 /mnt/ //把第二个分区也挂载过来,这样可以把2个操作系统的密码都恢复
    kjournald starting. Commit interval 5 seconds
    EXT3 FS on hda2, internal journal
    EXT3-fs: mounted filesystem with ordered data mode.
    sh-2.04#
    sh-2.04#
    sh-2.04# passwddefault //输入passwddefault 来恢复密码
    All account passwords have been successfully set to factory default.
    sh-2.04# reboot -f //reboot –f来重启san switch.
    Restarting system.
    重启过程省略......COPY
  5. 开机设置密码

    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
    34
    35
    san1 console login: admin
    Password:
    Please change passwords for switch default accounts now.
    Use Control-C to exit or press 'Enter' key to proceed.

    Warning: Access to the Root and Factory accounts may be required for
    proper support of the switch. Please ensure the Root and Factory
    passwords are documented in a secure location. Recovery of a lost Root
    or Factory password will result in fabric downtime.

    for user - root
    Changing password for root
    Enter new password:
    Re-type new password:
    passwd: all authentication tokens updated successfully
    Please change passwords for switch default accounts now.
    for user - factory
    Changing password for factory
    Enter new password:
    Re-type new password:
    passwd: all authentication tokens updated successfully
    Please change passwords for switch default accounts now.
    for user - admin
    Changing password for admin
    Enter new password:
    Re-type new password:
    passwd: all authentication tokens updated successfully
    Please change passwords for switch default accounts now.
    for user - user
    Changing password for user
    Enter new password:
    Re-type new password:
    passwd: all authentication tokens updated successfully
    Saving passwords to stable storage.
    Passwords saved to stable storage successfullyCOPY

No.2: Firmware升级操作

firmware下载地址:https://ibm.brocadeassist.com/public/FabricOSv7xRelease

  1. 备份当前的配置文件
    命令: configupload ,详细信息请看上面维护操作的配置备份.

  2. 查看当前的Firmware版本

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Firmware版本:
    san1:admin> firmwareshow
    Primary partition: v5.0.1b
    Secondary Partition: v5.0.1b

    也是Fabric OS的版本:
    san1:admin> version
    Kernel: 2.4.19
    Fabric OS: v5.0.1b
    Made on: Wed Aug 17 21:28:18 2005
    Flash: Tue Jan 24 05:24:32 2006
    BootProm: 4.5.2COPY
  3. 在FTP Server上解压firmware包
    $ sudo tar zxvf v5.3.2c.tar.gz -C /srv/ftp/ //选择匿名登录,故而解压到/srv/ftp

  4. 使用firmwareDownload命令从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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    san1:admin> firmwareDownload
    You can run firmwareDownloadStatus to get the status
    of this command.

    This command will cause the switch to reset and will
    require that existing telnet, secure telnet or SSH
    sessions be restarted.

    Do you want to continue [Y]: y
    Server Name or IP Address: 10.172.28.103 //FTP服务器自个搭建哈
    User Name: //匿名,直接回车
    File Name: v5.1.0/release.plist //对于5.3.x之前的固件必须指定release.plist,之后的版本release.plist不再需要。
    Password: //匿名用户没密码,直接回车
    Firmwaredownload has started.
    Removing pcmcia-cs-3.1.29-2
    Removing fabos-fss-5.0.1b-9
    Start to install packages......
    dir ##################################################
    此处省略若干行.......
    lkcd ##################################################
    sysstat ##################################################
    Removing unneeded files, please wait ...
    Finished removing unneeded files.

    All packages have been downloaded successfully.
    Firmwaredownload has completed successfully.
    HA Rebooting ...

    重启后验证版本信息:
    san1:admin> version
    Kernel: 2.4.19
    Fabric OS: v5.1.0
    Made on: Thu Feb 23 01:55:30 2006
    Flash: Sat Jan 1 00:11:50 2000
    BootProm: 4.5.3
    san1:admin> firmwareshow
    Primary version: v5.1.0
    Secondary version: Unknown

    接着升级到 v6.0.1a 又失败了,只好先升到v5.3.2c,方法一样
    重启后验证版本信息:
    san1:admin> firmwareshow
    Appl Primary/Secondary Versions
    ------------------------------------------
    FOS v5.3.2c
    Unknown
    san1:admin> version
    Kernel: 2.6.14
    Fabric OS: v5.3.2c
    Made on: Wed Sep 30 16:51:09 2009
    Flash: Sat Jan 1 00:27:34 2000
    BootProm: 4.6.5

    接着升级到 v6.0.1a,步骤稍有点不同:
    san1:admin> firmwareDownload
    Server Name or IP Address: 10.172.28.103
    User Name:
    File Name: v6.0.1a/release.plist
    Network Protocol(1-auto-select, 2-FTP, 3-SCP) [1]: 2
    Password:
    Checking system settings for firmwaredownload...
    Protocol selected: FTP
    Trying address-->AF_INET IP: 10.172.28.103, flags : 2
    System settings check passed.

    You can run firmwaredownloadstatus to get the status
    of this command.

    This command will cause a warm/non-disruptive boot on the switch,
    but will require that existing telnet, secure telnet or SSH sessions
    be restarted.

    Do you want to continue [Y]: y
    Firmware is being downloaded to the switch. This step may take up to 30 minutes.
    Preparing for firmwaredownload...
    此处省略若干行......

    重启后验证版本信息:
    san1:admin> version
    Kernel: 2.6.14.2
    Fabric OS: v6.0.1a
    Made on: Thu May 22 17:55:05 2008
    Flash: Sat Jan 1 00:39:02 2000
    BootProm: 4.6.6
    san1:admin> firmwareshow
    Appl Primary/Secondary Versions
    ------------------------------------------
    FOS v6.0.1a
    v6.0.1aCOPY
    • 在升级的过程可以用firmwareDownloadStatus查看升级状态
    1
    2
    3
    4
    5
    6
    san1:root> firmwareDownloadStatus
    [1]: Sat Jan 1 00:24:39 2000
    Firmware is being downloaded to the switch. This step may take up to 30 minutes.

    [2]: Sat Jan 1 00:29:27 2000
    Firmware has been downloaded to the secondary partition of the switch.COPY
  5. 注意

    • 我准备直接升级到v6.0.1a的,结果报Firmwaredownload failed. (0x29) The pre-install script failed.错误,猜测应该是不能跨越太大版本.
    • 接着下载了v5.3.2c进行升级,报Cannot upgrade directly to 5.3. Please upgrade to 5.1 or 5.2 first and then upgrade to 5.3.,确定是不能跨越太大版本.

No.3: 级联配置

目的:端口的扩容
设备:两台EMC² MP-7500

  1. 确定级联License
    部分光纤交换机需要购买级联license(如博科200e光纤交换机),但有些光纤交换机级联license是出厂自带的(比如说博科300光纤交换机)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    san1:admin> licenseshow 
    cSzbbcdyQbdT0ccn:
    Obsolete license
    RRS9cQ9zR9SSTAdN:
    Obsolete license
    SQczdycQRSTRd0eA:
    Fabric license //级联License
    b9bcR9bdbRcAcdSG:
    Extended Fabric license //增加信号许可,两级联设备距离超过10KM,两端交换机都需要购买
    略......COPY
  2. 导入级联License
    拿到设备已经有级联License了,下面命令我没验证哈
    san01:admin> licenseadd xxxxxxxxxxxxxx

  3. 再次查看License
    san1:admin> licenseshow

  4. 更改Domain ID
    这里san0不修改,只改san2

    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
    34
    35
    san2:admin> switchdisable 
    san2:admin> configure
    Configure...

    Fabric parameters (yes, y, no, n): [no] y
    Domain: (1..239) [1] 2
    R_A_TOV: (4000..120000) [10000]
    E_D_TOV: (1000..5000) [2000]
    WAN_TOV: (0..30000) [0]
    MAX_HOPS: (7..19) [7]
    Data field size: (256..2112) [2112]
    Sequence Level Switching: (0..1) [0]
    Disable Device Probing: (0..1) [0]
    Suppress Class F Traffic: (0..1) [0]
    Per-frame Route Priority: (0..1) [0]
    Long Distance Fabric: (0..1) [0]
    BB credit: (1..27) [16]
    Disable FID Check (yes, y, no, n): [no]
    Insistent Domain ID Mode (yes, y, no, n): [no]
    Configure edge hold time (yes, y, no, n): [no]
    Virtual Channel parameters (yes, y, no, n): [no]
    F-Port login parameters (yes, y, no, n): [no]
    Zoning Operation parameters (yes, y, no, n): [no]
    RSCN Transmission Mode (yes, y, no, n): [no]
    Arbitrated Loop parameters (yes, y, no, n): [no]
    System services (yes, y, no, n): [no]
    Portlog events enable (yes, y, no, n): [no]
    ssl attributes (yes, y, no, n): [no]
    rpcd attributes (yes, y, no, n): [no]
    cfgload attributes (yes, y, no, n): [no]
    webtools attributes (yes, y, no, n): [no]

    WARNING: The domain ID will be changed. The port level zoning may be affected

    san2:admin> switchenable COPY
  5. 接级联跳线,并查看Switch端口状态

SAN Switch的zoning配置

注意:

  1. cfgenable和cfgdisable是对configuration的启用和关闭,该命令执行结束后无需执行cfgsave
  2. 对Alias,zone,configuration三个对象进行任何操作后都要执行cfgsave保存;
  3. zone配置的命令都可以用zoneHelp帮助命令查到;
  4. 在已有的生产环境中不能去重新建立并enable “configuration”文件(除了整个SAN环境的重建),将新的zone添加到现有的cfg配置中即可

No.1: 概述

配置 Zoning 需要涉及到三个对象的配置 Alias,Zone,Configuration。

  1. Alias(可选、但建议使用):

    别名,可以把设备的 WWN或 ”Domain,Port“ 声明为 Alias,两个作用:

    • 使更好更直观的标示设备。使用 Alias 的主要目的是方便用户的使用(类似身份证号和名字);
    • 声明Alias 的另外一个益处是便于 Zone 中成员的更换。当 Zone 中的某个成员更换时,如果定义了 Alias,只要修改 Alias 的定义而不用修改 Zone 的配置。
  2. Zone
    区域,Zone内的设备可以相互访问,但不能访问其他 Zone 的设备。
    Zone 的成员可以有三种:“Domain,Port“;”WWN”;”Alias”。 Zone 对成员的数量没有限制,可以同时有多个类型的多个设备同时存在于一个 Zone 中。

  3. Configuration

    • 在交换机上的一套关于 Zone 的配置,或者说一系列 Zone 的集合。它可以包含一个或多个 Zone 作为它的成员。
    • 在一个SAN 网络中可以有多个配置文件,但只能有一个处于Effective状态的配置文件,故而所有要使用的zone都要加到Effective状态的配置文件。
    • 在已有的SAN架构中配置新的zone也是加到Effective状态的配置文件,而不是以新的配置文件使其生效。
    • Zoning 的配置可以动态的进行,当使用 cfgEnable 指定某个配置成为生效的配置后,Zoning 的配置会立即在 SAN 网络中生效,隔离 Zone 间的相互访问。

No.2: 创建zoning配置

注:记住必须用cfgsave保存,和cfgenable让其生效

  1. 创建Alias

    • 基于WWPN的Alias创建:alicreate "Alias_name","WWN"
    • 基于port的Alias创建:alicreate "Alias_name","Domain,prot"
  2. 创建zone
    把别名或端口或WWPN分配到 zone 中,命令格式如下:

    • zonecreate "zone_name","Alias_name;Domain,prot;WWN;..."
    • zone的成员可以都写成别名或prot或WWN,也可以混着写(不建议这么做)
    • zone的成员是以;分割的;
  3. 创建configuration
    zone加入到配置文件中,命令格式如下:

    • cfgcreate "cfg_name","zone_name;zone_name;..."
  4. 保存配置
    cfgsave

  5. 使zone配置生效
    cfgenable "cfg_name"

  6. 实践

    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
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    san1:admin> switchshow
    此处省略若干行......
    switchDomain: 1
    此处省略若干行......
    Area Port Media Speed State
    ==============================
    0 0 id N2 Online F-Port 20:24:00:a0:b8:26:11:a6
    1 1 id N2 Online F-Port 20:25:00:a0:b8:26:11:a6
    2 2 id N2 Online F-Port 10:00:00:90:fa:ca:87:02
    3 3 id N2 Online F-Port 10:00:00:90:fa:ca:87:03
    4 4 id N2 No_Light
    5 5 id N2 No_Light
    6 6 id N2 No_Light
    7 7 id N2 No_Light
    此处省略若干行......
    san1:admin>
    san1:admin> alicreate "dsa","20:24:00:a0:b8:26:11:a6"
    san1:admin> alicreate "fc1","1,2"
    san1:admin> zonecreate "dsa_fc1","dsa;fc1"
    san1:admin> zonecreate "dsa_fc2","dsa;1,3"
    san1:admin> zonecreate "dsb_fc1","1,1;10:00:00:90:fa:ca:87:02"
    san1:admin> zonecreate "dsb_fc2","1,1;1,3"
    san1:admin> cfgcreate "cfg0","dsa_fc1;dsa_fc2;dsb_fc1;dsb_fc2"
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1; dsb_fc2
    zone: dsa_fc1 dsa; fc1
    zone: dsa_fc2 dsa; 1,3
    zone: dsb_fc1 1,1; 10:00:00:90:fa:ca:87:02
    zone: dsb_fc2 1,1; 1,3
    alias: dsa 20:24:00:a0:b8:26:11:a6
    alias: fc1 1,2

    Effective configuration:
    no configuration in effect

    san1:admin> cfgsave
    You are about to save the Defined zoning configuration. This
    action will only save the changes on Defined configuration.
    Any changes made on the Effective configuration will not
    take effect until it is re-enabled.
    Do you want to save Defined zoning configuration only? (yes, y, no, n): [no] yes
    Updating flash ...
    san1:admin> cfgenble cfg0
    此处省略若干行......
    COPY
    • 上述中是为了演示各种配置方式,zone成员采用了多种混合的方式表示的,正常情况是统一的一种方式。

No.3: 维护zoning配置

  1. 移除zone的成员:

    1
    zoneremove "zone_name","要移除的成员(Alias或WWN或Domain,port)"
    1
    2
    3
    4
    5
    6
    7
    8
    9
    san1:admin> cfgshow
    此处省略若干行......
    zone: dsb_fc2 1,1; 1,3
    此处省略若干行......
    san1:admin> zoneremove "dsb_fc2","1,3"
    san1:admin> cfgshow
    此处省略若干行......
    zone: dsb_fc2 1,1
    此处省略若干行......COPY
  2. 向zone中添加成员:

    1
    zoneadd "zone_name","要添加的成员(Alias或WWN或Domain,port)"
    1
    2
    3
    4
    5
    san1:admin> zoneadd "dsb_fc2","1,3"
    san1:admin> cfgshow
    ......
    zone: dsb_fc2 1,1; 1,3
    ......COPY
  3. 在配置文件中移除zone:

    1
    cfgremove "cfg_name","要移除的zone"
    1
    2
    3
    4
    5
    6
    7
    8
    9
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1; dsb_fc2
    ......
    san1:admin> cfgremove "cfg0","dsb_fc2"
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1
    ......COPY
  4. 向已有配置文件添加zone:

    1
    cfgadd "cfg_name","要添加的zone"
    1
    2
    3
    4
    5
    san1:admin> cfgadd "cfg0","dsb_fc2"
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1; dsb_fc2
    ......COPY
  5. 注意

    • 一次的维护操作结束后应执行cfgsave进行保存;*
    • 维护操作结束后还应执行cfgenable cfg_name,让配置立即生效.

No.4: 删除zoning配置

  1. 先看看当前的配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    san1:admin> cfgshow
    Defined configuration:
    cfg: cfg0 dsa_fc1; dsa_fc2; dsb_fc1; dsb_fc2
    zone: dsa_fc1 dsa; fc1
    zone: dsa_fc2 dsa; fc2
    zone: dsb_fc1 dsb; fc1
    zone: dsb_fc2 dsb; fc2
    alias: dsa 1,0
    alias: dsb 1,1
    alias: fc1 1,2
    alias: fc2 1,3

    Effective configuration:
    cfg: cfg0
    zone: dsa_fc1 1,0
    1,2
    zone: dsa_fc2 1,0
    1,3
    zone: dsb_fc1 1,1
    1,2
    zone: dsb_fc2 1,1
    1,3COPY
  2. 清除当前所有zoning配置

    • 先关闭处于Effective状态的配置文件,命令:cfgdisable
    • 接着清除当前所有zone配置,命令: cfgclear
    • 保存当前设置(如果不保存交换机重启后原来的配置还在),命令: cfgsave
    • 实践:
    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
    san1:admin> cfgdisable
    You are about to disable zoning configuration. This
    action will disable any previous zoning configuration enabled.
    Do you want to disable zoning configuration? (yes, y, no, n): [no] yes
    Updating flash ...
    san1:admin> cfgclear
    The Clear All action will clear all Aliases, Zones, FA Zones
    and configurations in the Defined configuration.
    Do you really want to clear all configurations? (yes, y, no, n): [no] yes
    san1:admin>
    san1:admin> cfgsave
    You are about to save the Defined zoning configuration. This
    action will only save the changes on Defined configuration.
    Any changes made on the Effective configuration will not
    take effect until it is re-enabled.
    Do you want to save Defined zoning configuration only? (yes, y, no, n): [no] yes
    Updating flash ...
    san1:admin>
    san1:admin> reboot

    ......

    dream@Mint ~ $ telnet 10.172.28.6
    ......
    san1:admin> cfgshow
    Defined configuration:
    no configuration defined

    Effective configuration:
    no configuration in effectCOPY
  3. 删除单个对象

    • 删除Alias: alidelete Alias_name

    • 删除zone: zonedelete zone_name

    • 删除configuration: cfgdelete cfg_name

    • 实践:

      1
      2
      3
      4
      5
      6
      san1:admin> alidelete dsa
      san1:admin> zonedelete dsa_fc1
      san1:admin> cfgdelete cfg0
      san1:admin>
      san1:admin> cfgsave
      略......

CheckPoint R80.10虚拟机版本安装与Smartconsole安装

R80是CheckPoint最新的安全操作系统版本,今天来动手安装一下虚拟机版本的CheckPoint R80.10系统

CheckPoint的安装镜像为ISO格式,虚拟机与物理机使用相同的镜像。

进入vSphere后,开始部署虚拟机,选择虚拟机位置与虚拟机名称

2022-02-10_13-39-25

选择存储资源2022-02-10_13-40-31

2022-02-10_13-40-47

选择其他其他Linux 64位版

2022-02-10_13-41-12

选择硬盘时注意要选SATA控制器,否则会导致不认盘

2022-02-10_13-41-58

网卡数量按照需求添加,网卡型号选择E10002022-02-10_13-42-39

挂载R80的镜像,勾选打开电源时连接2022-02-10_13-43-19

image-20220210145857088

完成后启动虚拟机

image-20220210145914144

image-20220210145925594

默认

image-20220210145935214

各分区大小按照需求配置,这里使用默认空间分配大小

image-20220210150008353

配置admin的密码

image-20220210150047320

选择网卡作为管理接口

image-20220210150102730

设置管理IP以及掩码和网关

image-20220210150119571

image-20220210150125165

开始安装image-20220210150133001

安装完成后重启系统

image-20220210150140140

打开https://10.8.1.41进入初始化配置,用户名admin,密码为刚刚自己定义的密码

image-20220210150247444

image-20220210150316623

image-20220210150320781

管理IP可以更改

image-20220210150431933

image-20220210150439005

配置主机名,DNS

image-20220210150452073

设置时间与时区,如果有NTP服务器可以选择NTP

image-20220210150518849

image-20220210150527475

选择Security Management(SMS)

image-20220210150531718

image-20220210150747167

image-20220210150754319

完成配置image-20220210150812852

image-20220210150826559

等待配置全部完成

image-20220210150836599

完成后自动跳转至管理页面,下载SmartConsole安装包

image-20220210150910414

Install安装

image-20220210150920261

image-20220210150944709

安装完成后启动SmartConsole

image-20220210151008872

输入用户名密码以及IP地址

image-20220210151017883

不检查证书,选择继续

image-20220210151146165

一些SmartConsole的使用提示

image-20220210151211521

image-20220210151215998

image-20220210151219686

image-20220210151242827

image-20220210151247779

image-20220210151251743

R80以上的版本提供了汉化功能,汉化需下载一个汉化补丁包LanguageConfigPatch.zip

下载解压后将LanguageConfigPatch.exe文件复制到SmartConsole的安装目录,并运行,提示seccess后即可在SmartConsole中设置语言

image-20220210151754246

新版SmartConsole中,save键变为了发布(Publish)

以上,CheckPoint R80的基本安装已经完成,如有更多内容以后补充

CentOS7系统配置国内yum源和epel源

1.首先进入/etc/yum.repos.d/目录下,新建一个repo_bak目录,用于保存系统中原来的repo文件

1
2
3
4
5
[root@bogon ~]# cd /etc/yum.repos.d/

[root@bogon yum.repos.d]# mkdir repo_bak

[root@bogon yum.repos.d]# mv *.repo repo_bak/

2.在CentOS中配置使用网易和阿里的开源镜像

到网易和阿里开源镜像站点下载系统对应版本的repo文件

1
2
3
4
5
6
[root@bogon yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo

[root@bogon yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

[root@bogon yum.repos.d]# ls
Centos-7.repo CentOS-Base-163.repo repo.bak

或者手动下载repo文件并上传到/etc/yum.repos.d/目录

网易开源镜像站

阿里开源镜像站

3.清除系统yum缓存并生成新的yum缓存

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
34
35
36
[root@bogon yum.repos.d]# ls    	# 列出/etc/yum.repos.d/目录下的文件
Centos-7.repo CentOS-Base-163.repo repo.bak

[root@bogon yum.repos.d]# yum clean all # 清除系统所有的yum缓存
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors

[root@bogon yum.repos.d]# yum makecache # 生成yum缓存
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/12): base/7/x86_64/filelists_db | 6.7 MB 00:00:02
(2/12): base/7/x86_64/group_gz | 156 kB 00:00:02
(3/12): base/7/x86_64/other_db | 2.5 MB 00:00:01
(4/12): base/7/x86_64/primary_db | 5.7 MB 00:00:02
(5/12): extras/7/x86_64/prestodelta | 51 kB 00:00:01
(6/12): extras/7/x86_64/filelists_db | 494 kB 00:00:02
(7/12): extras/7/x86_64/other_db | 86 kB 00:00:00
(8/12): extras/7/x86_64/primary_db | 130 kB 00:00:01
(9/12): updates/7/x86_64/prestodelta | 406 kB 00:00:01
(10/12): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01
(11/12): updates/7/x86_64/other_db | 354 kB 00:00:00
(12/12): updates/7/x86_64/primary_db | 3.6 MB 00:00:01
Determining fastest mirrors
Metadata Cache Created

4.安装epel源

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[root@bogon yum.repos.d]# yum list | grep epel-release
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
epel-release.noarch 7-9 extras

[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================
Package Arch Version Repository Size
=============================================================================================================
Installing:
epel-release noarch 7-9 extras 14 k

Transaction Summary
=============================================================================================================
Install 1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-9.noarch 1/1
Verifying : epel-release-7-9.noarch 1/1

Installed:
epel-release.noarch 0:7-9

Complete!
[root@bogon yum.repos.d]# ls # epel源安装成功,比原来多了一个epel.repo和epel-testing.repo文件
Centos-7.repo CentOS-Base-163.repo epel.repo epel-testing.repo repo.bak

5.使用阿里开源镜像提供的epel源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo    # 下载阿里开源镜像的epel源文件
--2018-03-08 20:22:14-- http://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 183.2.199.237, 113.96.109.95, 113.96.109.93, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|183.2.199.237|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1084 (1.1K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel-7.repo’

100%[=================================================================================================>] 1,084 --.-K/s in 0s

2018-03-08 20:22:14 (130 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [1084/1084]

[root@bogon yum.repos.d]# ls
CentOS7-Base-163.repo Centos-7.repo epel-7.repo epel.repo epel-testing.repo repo_bak

6.再次清除系统yum缓存,并重新生成新的yum缓存

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[root@bogon yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Cleaning repos: base epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors

[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/18): base/7/x86_64/group_gz | 156 kB 00:00:01
(2/18): base/7/x86_64/filelists_db | 6.7 MB 00:00:07
(3/18): base/7/x86_64/primary_db | 5.7 MB 00:00:06
(4/18): epel/x86_64/group_gz | 266 kB 00:00:01
(5/18): epel/x86_64/updateinfo | 899 kB 00:00:02
(6/18): epel/x86_64/prestodelta | 7.1 kB 00:00:00
(7/18): base/7/x86_64/other_db | 2.5 MB 00:00:05
(8/18): epel/x86_64/primary_db | 6.3 MB 00:00:04
(9/18): extras/7/x86_64/filelists_db | 636 kB 00:00:00
(10/18): extras/7/x86_64/primary_db | 166 kB 00:00:00
(11/18): extras/7/x86_64/other_db | 108 kB 00:00:00
(12/18): extras/7/x86_64/prestodelta | 102 kB 00:00:01
(13/18): epel/x86_64/other_db | 3.0 MB 00:00:01
(14/18): epel/x86_64/filelists_db | 10 MB 00:00:09
(15/18): updates/7/x86_64/filelists_db | 3.5 MB 00:00:02
(16/18): updates/7/x86_64/prestodelta | 771 kB 00:00:02
(17/18): updates/7/x86_64/other_db | 621 kB 00:00:00
(18/18): updates/7/x86_64/primary_db | 6.0 MB 00:00:03
Determining fastest mirrors
* epel: mirrors.aliyun.com
Metadata Cache Created

7.查看系统可用的yum源和所有的yum源

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
34
35
36
37
38
39
40
41
42
[root@bogon yum.repos.d]# yum repolist enabled
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com 9,591
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,382
extras/7/x86_64 CentOS-7 - Extras - 163.com 390
updates/7/x86_64 CentOS-7 - Updates - 163.com 1,941
repolist: 24,304

[root@bogon yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* epel: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - 163.com enabled: 9,591
centosplus/7/x86_64 CentOS-7 - Plus - 163.com disabled
contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,382
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source disabled
extras/7/x86_64 CentOS-7 - Extras - 163.com enabled: 390
updates/7/x86_64 CentOS-7 - Updates - 163.com enabled: 1,941
repolist: 24,304

原作者:flytoyou

Exchange2019部署安装

要求

Exchange 2019 目录服务器要求

域控制器:林中的所有域控制器都需要运行 Windows Server 2012 R2 Standard 或 Datacenter版本以上
Active Directory 林的功能级别:Windows Server 2012 R2 或更高版本。

Exchange 2019支持的操作系统:

邮箱和边缘传输服务器角色:Windows Server 2019 Standard 或 Datacenter
管理工具:Windows Server 2019 Standard或Datacenter和64位版本的 Windows 10

Exchange 2019 支持的共存方案

Exchange 2010 和早期版本:不支持
Exchange 2013: 与组织中所有 Exchange 2013 服务器(包括边缘传输服务器)上的 Exchange 2013 累积更新 21 (CU21) 或更高版本一起受到支持
Exchange 2016:与组织中所有 Exchange 2016 服务器(包括边缘传输服务器)上的 Exchange 2016 CU11 或更高版本一起受到支持。
Exchange 2013 和 Exchange 2016 的混合部署:如果组织中的所有 Exchange 2013 和 Exchange 2016 服务器都满足上面所说的要求,则受到支持。

规划

主机名:ExcNode1
IP地址:192.168.1.100/24
网关:192.168.1.1
**DNS:**192.168.1.199

安装

解决先决条件

2020042304354272

2020042304361716

1
Install-WindowsFeature Server-Media-Foundation, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS

2020042305015620

安装主程序

  • 挂载Exchange 2019 光盘文件,并运行Setup.exe 程序

2020042305052076

  • 为节约时间选择“现在不检查更新”后续可以自己更新

2020042305094999

  • 安装程序正在复制安装所需的文件

img

  • 文件复制完成后便开始进入向导安装。

2020042305143054

  • 接受许可协议条款

2020042305153412

  • 选择“不使用推荐设置”

2020042305165534

  • 在服务器角色选择页面勾选邮箱角色 。从exchange 2016 起,exchange 将2013中的客户端访问角色和邮箱角色合并为邮箱角色。

2020042305181244

  • 选择exchange server的安装路径。根据实际情况选择,不建议安装在系统盘。

202004230519269

  • 指定exchange组织的名称

202004230521263

  • 恶意软件防护设置,按需选择,比较弱鸡,外层有邮件网关的可以不开启。

2020042305224231

  • 分析先决条件,没有错误即可开始安装

2020042305234512

202004230524332

  • 开始安装,整个过程共14步,安装速度与机器配置有关,请耐心等待。

2020042305254667

  • 安装完成

2020042305264214

  • 访问owa页面可以正常打开,安装到此结束。

2020042305272324

其他详细参数详见官方文档

Catalyst 9000系列IOS-XE升级

C9000系列使用Install模式进行版本升级需要注意,从IOS-XE 16.10.1开始,思科不再推荐使用 “request platform software”命令进行IOS升级(但命令还是可以敲的),而是推荐使用下文提到的命令进行升级。单台设备或堆叠组都可以这样升级。

第一步:

清除flash里未在使用中的文件

1
Switch# install remove inactive

中间会弹提示,直接y就行

1
Do you want to remove the above files? [y/n]y

然后会提示清除成功

1
SUCCESS: install_remove Tue Jul 10 19:52:25 UTC 2018

第二步:

将.bin文件copy至设备flash:,这里就不废话了

1
2
Switch# copy tftp://10.8.0.6//cat9k_iosxe.16.09.01.SPA.bin flash:
Destination filename [cat9k_iosxe.16.09.01.SPA.bin]?

第三步:

设置启动项

1
2
Switch(config)# boot system flash:packages.conf
Switch(config)# exit

然后保存

第四步:

执行安装命令

1
2
3
Switch# install add file flash:cat9k_iosxe.16.09.01.SPA.bin activate commit

install_add_activate_commit: START Tue Jul 10 19:54:51 UTC 2018

安装完成后会询问是否要重启,敲y就行

实测三台堆叠升级用了不到二十分钟,比传统直接boot bin文件的方式快太多了,并且升级只需要执行一次上述的步骤,整个堆叠组就都能完成升级,不需要再在slot 1,slot 2 ,slot 3…….一次去修改boot了。Install模式的设备启动速度也是很快,基本上一行#就进去了。

思科9300交换机密码重置

这是一个真实的案例,当时就是粘贴后发现用任何方式连接不上交换机了。
重置一个密码应该是很简单的事,网上多的是这种文档,但是你会发现,你根本切换不到Boot Loader,我都快把那个Mode键按碎了。这时候你基本处于绝望中。
我的经验就是不去搜索国内的文档,都是那些互相抄袭而且没有工程经验的人写的东西,找思科的工程师,也是说开机时按Mode键,然后会进入一个Boot Loader,然后告诉他这样不可以,人家说这种产品有点新,也没有资料。

以下是我们用血泪史换来的经验,记住,最重要的一步是在加电开始时,不要长按Mode键,这种操作是绝对错误的。重点是在开机启动时,短按Mode键三次,然后奇迹就发生了。
你就可以正常进入到Boot Loader了。
看到switch:提示符时都他妈的想哭了,原因是跟老外都约好了调试时间,然后把一台交换机给玩得无法登录了,这是多丢人的一件事
看到switch提示符后,这样做
加一个变量

1
switch: SWITCH_IGNORE_STARTUP_CFG=1

重启交换机

1
Switch:boot

交换机重启后你把一个原来的配置再复制回去

1
Switch#copy start runn

然后设置你的密码

再把刚才的变量给干掉

1
Switch#no system ignore startupconfig switch all

再保存你的配置。

1
Switch# copy runn start

当然,在Boot Loader里,你可以把那个配置文件给干掉,这都很灵活的处理了。

大体上的方法就是这样。

你可以去全网搜索这个重置的文档,都在说长按Mode键,等指示灯变成琥珀色,你们试过没有就来这样写,互相抄袭文章。

EVE-NG模拟器基本配置及关联SecureCRT、Wireshark及VNC

 EVE-NG(全称Emulated Virtual Environment – NextGeneration),继Unetlab 1.0后的Unetlab的2.0新版本,改了名字,原名是UnifiedNetworking Lab统一网络实验室。笔者觉得名字改的非常合理,这款模拟器已经不仅可以模拟网络设备,也可以运行一切虚拟机。理论上,只要能将虚拟机的虚拟磁盘格式转换为qcow2都可以在EVE-NG上运行。所以,EVE-NG可以算得上是仿真虚拟环境。EVE-NG是国外大神们开发的,融合了dynamips,IOL,KVM。它是深度定制的Ubuntu操作系统,可以直接把它安装在x86架构的物理主机上。它也有ova版本,可以导入到VMware等虚拟机软件中运行。EVE-NG在交互模式上更加具有优势,与GNS3截然不同。GNS3更像是用户使用的软件,只有GNS3支持的 OS才能使用;而EVE-NG更像是CS模型,EVE-NG是服务端,用户端可以是支持http/https的任意OS。

EVE-NG模拟器的安装配置

  可以在EVE-NG官网下载到ova格式的虚拟机文件,在VMware Workstation Pro或vSphere等虚拟机中导入即可,root的默认密码是eve,老版本可能是unl,第一次进入系统会进入初始化配置界面,按照向导进行设置即可,之后会自动进行重启,再次进入系统可以使用apt-get update获取更新列表,然后使用apt-get install eve-ng安装eve-ng的更新版本。

  使用vim将下面的python脚本写到文件,然后使用命令pydoc3 文件名执行后即可进行破解并自动写入序列号。

CiscoIOUKeygen.py

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
#! /usr/bin/python
print("*********************************************************************")
print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version")
print("Modified to work with python3 by c_d 2014")
import os
import socket
import hashlib
import struct

# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
ioukey=int(hostid,16)
for x in hostname:
ioukey = ioukey + ord(x)
print("hostid=" + hostid +", hostname="+ hostname + ", ioukey=" + hex(ioukey)[2:])

# create the license using md5sum
iouPad1 = b'\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A'
iouPad2 = b'\x80' + 39*b'\0'
md5input=iouPad1 + iouPad2 + struct.pack('!I', ioukey) + iouPad1
iouLicense=hashlib.md5(md5input).hexdigest()[:16]

print("\nAdd the following text to ~/.iourc:")
print("[license]\n" + hostname + " = " + iouLicense + ";\n")
print("You can disable the phone home feature with something like:")
print(" echo '127.0.0.127 xml.cisco.com' >> /etc/hosts\n")


lic = ["[license]\n" + hostname + " = " + iouLicense + ";" + "\n"]
f = open('/opt/unetlab/addons/iol/bin/iourc','w')
f.writelines(lic)
f.close()

IOL和QEMU设备导入路径分别为:/opt/unetlab/addons/iol/bin以及/opt/unetlab/addons/qemu,导入后需执行以下命令对权限进行修复:/opt/unetlab/wrappers/unl_wrapper -a fixpermissions

  至此EVE模拟器的配置部分结束,EVE前台的用户名和密码默认为admin/eve

关联SecureCRT

  建议安装SecureCRT 8.1及其以上版本,打开http://EVE-NG地址/files/windows.zip下载eve-ng的Windows关联文件,然后使用文本编辑工具编辑win7_64bit_crt.reg注册表文件。

  将上述文件中的SecureCRT路径改成系统中SecureCRT的实际安装路径,默认安装在C盘,如果你的SecureCRT是一路默认安装的,此处一般情况下不需要再进行修改,确认无误后,双击导入注册表即可。

  最后将解压出来的UNetLab目录复制到C:\Program Files\目录下!

关联Wireshark

  下载安装一个Wireshark,然后需要下载一个plink.exe,下面链接是64位系统的pink,https://the.earth.li/~sgtatham/putty/latest/w64/plink.exe。

  将下载回来的plink.exe复制到C:\Program Files\UNetLab下,然后双击win7_64bit_wireshark.reg导入注册表进行关联,然后编辑wireshark_wrapper.bat将最开头的root密码修改为正确的root密码即可,默认eve

关联VNC

  测试使用安装的VNC版本是VNC Viewer Enterprise Edition E4.29,有尝试过最新版的VNC,传参有问题,懒得研究就找了一个直接就能用的版本,和之前的关联设置差不多,打开C:\Program Files\UNetLab,找到ultravnc_wrapper.bat并进行编辑,修改VNC路径,并删-connect参数,即可使用,不同版本VNC的参数可能不同,反正我是不知道需要用-connect的是哪个版本VCN,用4.29删除该参数就可以直接使用,然后导入win7_64bit_ultravnc.reg即可完成关联操作。

F&Q

如果找不到上述操作中的http://EVE-NG地址/files/windows.zip文件,可以尝试搜索的方式寻找

1
find / -name windows.zip

使用脚本下载最新的ESXI

要求

  • 装有 Powershell 2.0 或更新版本的 Windows 计算机(XP 或更新版本)
  • VMware PowerCLI 5.1 或更高版本

ESXi-Customizer-PS 是您从 Powershell 或 PowerCLI 控制台窗口中启动的 Powershell 脚本。它接受各种命令行选项。其中之一是-help,它将显示此帮助屏幕:

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
34
35
36
C:\Desktop> .\ESXi-Customizer-PS.ps1 -help

This is ESXi-Customizer-PS Version 2.8.1 (visit https://ESXi-Customizer-PS.v-front.de for more information!)

Usage:
ESXi-Customizer-PS [-help] | [-izip <bundle> [-update]] [-sip] [-v70|-v67|-v65|-v60|-v55|-v51|-v50]
[-ozip] [-pkgDir <dir>[,...]] [-outDir <dir>] [-vft] [-dpt depot1[,...]]
[-load vib1[,...]] [-remove vib1[,...]] [-log <file>] [-ipname <name>]
[-ipdesc <desc>] [-ipvendor <vendor>] [-nsc] [-test]

Optional parameters:
-help : display this help
-izip <bundle> : use the VMware Offline bundle <bundle> as input instead of the Online depot
-update : only with -izip, updates a local bundle with an ESXi patch from the VMware Online depot,
combine this with the matching ESXi version selection switch
-pzip : use an Offline patch bundle instead of the Online depot with -update.
-pkgDir <dir>[,...]: local directories of Offline bundles and/or VIB files to add (if any, no default)
-ozip : output an Offline bundle instead of an installation ISO
-outDir <dir> : directory to store the customized ISO or Offline bundle (the default is the
script directory. If specified the log file will also be moved here.)
-vft : connect the V-Front Online depot
-dpt depot1[,...] : connect additional Online depots by URL or local Offline bundles by file name
-load vib1[,...] : load additional packages from connected depots or Offline bundles
-remove vib1[,...] : remove named VIB packages from the custom Imageprofile
-sip : select an Imageprofile from the current list
(default = auto-select latest available standard profile)
-v70 |
-v67 | -v65 | -v60 |
-v55 | -v51 | -v50 : Use only ESXi 7.0/6.7/6.5/6.0/5.5/5.1/5.0 Imageprofiles as input, ignore other versions
-nsc : use -NoSignatureCheck with export
-log <file> : Use custom log file <file>
-ipname <name>
-ipdesc <desc>
-ipvendor <vendor> : provide a name, description and/or vendor for the customized
Imageprofile (the default is derived from the cloned input Imageprofile)
-test : skip package download and image build (for testing)

基本上该脚本具有三种不同的操作模式:

  1. 从 VMware Online depot(标准模式)创建 ESXi 安装 ISO 或 Offline Bundle
  2. 从本地 ESXi 脱机包创建 ESXi 安装 ISO 或脱机包(*-izip*模式)
  3. 使用 VMware Online depot 中的 ESXi 补丁包更新本地 ESXi Offline Bundle(*-izip -update*模式)

通过这三种模式,您可以选择从 V-Front 在线仓库、任何其他在线仓库(通过 URL)或本地存储的离线捆绑包和 VIB 文件(例如下载的驱动程序或软件包)添加捆绑包。

开始使用

1、以管理员身份运行PowerShell,安装VMware PowerCLI

1
Install-Module -Name VMware.PowerCLI

2、下ESXi-Customizer-PS.ps1

3、使用PowerShell运行脚本

1
.\ESXi-Customizer-PS.ps1

4、部分人运行PowerShell脚本.ps1时提示没有权限,需要设置执行权限

1
set-executionpolicy remotesigned 

使用实例

1、最简单的使用方法,下载最新的ESXI版本,ISO 文件将在脚本目录中创建

1
.\ESXi-Customizer-PS.ps1

可以使用以下一个或多个参数来修改下载的版本:

  • -v50:创建最新的 ESXi 5.0 ISO
  • -v51:创建最新的 ESXi 5.1 ISO
  • -v55 :创建最新的 ESXi 5.5 ISO
  • -v60 :创建最新的 ESXi 6.0 ISO
  • -v65 :创建最新的 ESXi 6.5 ISO
  • -v67 :创建最新的 ESXi 6.7 ISO
  • -v70 :创建最新的 ESXi 7.0 ISO
  • -outDir:将 ISO 文件写入自定义目录。如果使用此命令,则脚本的日志文件也将移至此处,并以 Imageprofile 名称和时间戳命名。
  • -sip:不自动下载最新的ESXI版本(=补丁级别),而是在菜单中显示所有版本并选择一个特定的。菜单将以发布日期进行排序。它还将列出仅包含安全修复和/或不包含 VMware Tools 的ISO配置文件。
  • -ozip:不输出安装 ISO,而是输出 ESXi Offline Bundle,可用于导入更新管理器、使用 esxcli 进行命令行修补或作为进一步自定义的输入

2、 使用 ESXi Offline Bundle 作为输入(而不是 VMware Online depot):

1
.\ESXi-Customizer-PS.ps1 -izip .\VMware-ESXi-6.0.0-2494585-depot.zip

ESXi Offline Bundles 可以从VMware Patch Download 门户下载。一些硬件供应商(例如 HP和Dell)还提供他们定制的 ESXi 版本作为离线包(这些可以在 vSphere 下载页面上找到),最终可以使用此脚本创建自己的定制的 ESXi 离线包

3、从在线仓库添加额外的包

1
.\ESXi-Customizer-PS.ps1 -v55 -load net-r8168,net-r8169,net-sky2

此脚本调用将构建最新的 ESXi 5.5 安装 ISO,其中添加了 ESXi 5.5 中删除的 NIC 驱动程序。这些软件包仍在 VMware Online Depot 中,因为它们是所有 ESXi 5.0 和 5.1 映像配置文件的一部分,并且脚本只是将它们重新添加到最新的 ESXi 5.5 映像配置文件中

4、添加本地离线包和/或 VIB 文件

1
.\ESXi-Customizer-PS.ps1 -pkgDir C:\temp\pkg

此命令将添加存储在目录C:\temp\pkg中的所有离线包和 VIB 文件。通过这种方式,可以添加第三方或者社区支持的设备驱动程序和软件包

作者:myfreax

出处:[https://www.myfreax.com/how-to-create-a-sudo-user-on-ubuntu/]

sudo命令旨在允许用户使用其他用户(默认情况下为root用户)的安全特权运行程序。

在本指南中,我们将向您展示如何在Ubuntu计算机上创建新用户并赋予其sudo访问权限。然后,您可以使用该用户帐户执行管理命令,而无需以root用户身份登录到Ubuntu服务器。

创建sudo用户的步骤

请按照以下步骤创建一个新的用户帐户并授予其sudo访问权限。如果要为现有用户配置sudo,请跳至步骤3。

1.登录到您的服务器。

以root用户身份登录到系统:

1
ssh root@server_ip_address

Copy

2.创建一个新的用户帐户

使用adduser命令创建一个新的用户帐户。不要忘记将username替换为您要创建的用户名:

1
adduser username

Copy

系统将提示您设置并确认新的用户密码。确保新帐户的密码尽可能强。

1
2
3
4
5
6
7
8
Adding user `username' ...
Adding new group `username' (1001) ...
Adding new user `username' (1001) with group `username' ...
Creating home directory `/home/username' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully

Copy

设置密码后,该命令将为用户创建一个主目录,在该主目录中复制几个配置文件,并提示您设置新用户的信息。如果您想将所有这些信息留空,请按ENTER接受默认设置。

1
2
3
4
5
6
7
8
Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]

Copy

3.将新用户添加到sudo

默认情况下,在Ubuntu系统上,组sudo的成员被授予sudo访问权限。要将创建的用户添加到sudo组,请使用usermod命令:

1
usermod -aG sudo username

Copy

测试sudo访问权限

切换到新创建的用户:

1
su - username

Copy

使用 sudo命令运行whoami命令:

1
sudo whoami

Copy

如果用户具有sudo访问权限,则whoami命令的输出将为“ root”:

1
root

Copy

如何使用sudo

要使用sudo,只需在命令前加上sudo和空格即可:

1
sudo ls -l /root

Copy

首次在会话中使用sudo时,系统会提示您输入用户密码:

1
[sudo] password for username: