找到
86
篇与
OWLSAMA
相关的结果
- 第 6 页
-
ubuntu设置 SSH 通过密钥登录 1、生成秘钥 为了使用秘钥,我们必须自己生成一对秘钥 生成秘钥可以按照以下步骤 在服务器上运行 user@host :~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): # 直接回车确认路径及文件按名字,也可以自己起名字 Enter passphrase (empty for no passphrase): #输入密钥锁码,或直接按 Enter 留空秘钥密码锁,这个密码是打开秘钥使用的,在此可以直接回车 Enter same passphrase again: #再输入一遍密钥锁码 Your identification has been saved in /home/user/.ssh/id_rsa. # 私钥生成 Your public key has been saved in /home/user/.ssh/id_rsa.pub. #公钥生成 The key fingerprint is: 0f:d3:e7:1a:1c:bd:5c:03:f1:19:f1:22:df:9b:cc:08 现在,在 user 用户的home目录中生成了一个 .ssh 的隐藏目录,内含两个密钥文件。id_rsa 为私钥,id_rsa.pub 为公钥 到此,秘钥就生成完毕了 2、关闭密码登录并开启ssh秘钥登录 编辑 /etc/ssh/sshd_config 文件 确保秘钥认证的2个配置是yes状态 RSAAuthentication yes PubkeyAuthentication yes重启ssh服务 sudo service sshd restart3、使用秘钥登录 将/home/user/.ssh/id_rsa 私钥下载到client的保存,注意,私钥的权限普通用户不能读写,需要修改权限或者提权才能复制。登录时将私钥导入即可登录。 4、最后关闭密码登录 PasswordAuthentication no
-
PXE服务器部署 1、准备一台Linux服务器作为PXE服务器,最好是带有图形界面的我这里以centos7.9为例 2、把服务器的防火墙和selinux关闭 #关闭防火墙 systemctl stop firewalld #关闭开机自启 systemctl disable firewalld setenforce 0 #修改selinux配置文件 vi /etc/selinux/config SELINUX=disable3、把需要安装系统的服务器与PXE服务器相连接 可以使用交换机也可以直连 4、设置PXE服务器的IP IPADDR=10.1.1.2 NETMASK=255.255.255.0 GATEWAY=10.1.1.254 DNS1=10.1.1.254 ONBOOT=yes BOOTPROTO=static #重启网络 systemctl restart network5、安装PXE需要的软件 yum install -y dhcp xinetd tftp tftp-server7、拷贝DHCP模板 cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf8、修改DHCP配置文件 vi /etc/dhcp/dhcpd.conf next-server 10.1.1.2; filename "pxelinux.0"; subnet 10.1.1.0 netmask 255.255.255.0 { range 10.1.1.50 10.1.1.100; option domain-name-servers 10.1.1.254; option domain-name "internal.example.org"; option routers 10.1.1.254; option broadcast-address 10.1.1.255; default-lease-time 600; max-lease-time 7200; }9、重启DHCP服务并验证 systemctl restart dhcpd systemctl enable dhcpd客户端服务器PXE启动,看是否能获取到IP地址 10、编辑TFTP配置文件 vi /etc/xinetd.d/tftp disable = no systemctl restart xinetd systemctl enable xinetd11、获取pxelinux.0并放置到TFTP根目录 yum -y install syslinux cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/12、创建规定目录 mkdir /var/lib/tftpboot/pxelinux.cfg13、挂载光盘 mount /dev/cdrom /media cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default cp /media/isolinux/* /var/lib/tftpboot/14、搭建网络安装源 yum -y install httpd systemctl restart httpd systemctl enable httpd mkdir /var/www/html/centos cd / mount /dev/cdrom /var/www/html/centos/浏览器访问测试 http://10.1.1.2/centos 15、创建yum源 vi /etc/yum.repos.d/pxe.repo [development] name=pxe baseurl=http://10.1.1.2/centos enabled=1 gpgcheck=0 :wq yum clean all yum list all16、制作自动化安装脚本 yum -y install system-config-kickstart system-config-kickstart按实际情况配置 然后保存到root目录下 mkdir /var/www/html/ks cp /root/kscentos.cfg /var/www/html/ks/打开浏览器查看http://10.1.1.2/ks 17、把配置文件放到最终的配置文件中 vi /var/lib/tftpboot/pxelinux.cfg/default #启动等待时间 默认是600 就是60秒这里我改成了6秒 timeout 60 label linux menu label ^Install CentOS 7.9 menu default kernel vmlinuz append initrd=initrd.img ks=http://10.1.1.2/ks/centos.cfg :wq18、打开客户端就可以自动安装了,如果是虚拟机 内存一定要大于1G 不然会出现RTNETLINK answers: File exists 19、如果想换成其他镜像执行一下命令 先卸载原有镜像 umount -a再挂载 mount /dev/cdrom /media替换文件 cp /media/isolinux/* /var/lib/tftpboot/ks centos7的系统通用所以不用更改
-
各厂商链路聚合配置 一、华三设备链路聚合配置 静态链路聚合 SW1: [H3C-1]interface Bridge-Aggregation 1 [H3C-1-Bridge-Aggregation1]quit [H3C-1]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/6 [H3C-1-if-range]port link-aggregation group 1SW2: [H3C-2]interface Bridge-Aggregation 1 [H3C-2-Bridge-Aggregation1]quit [H3C-2]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/6 [H3C-2-if-range]port link-aggregation group 1查看端口聚合状态 <H3C>display link-aggregation verbose <H3C>display interface brief 动态链路聚合 SW1: [H3C-1]interface Bridge-Aggregation 1 [H3C-1-Bridge-Aggregation1]link-aggregation mode dynamicSW2: [H3C-2]interface Bridge-Aggregation 1 [H3C-2-Bridge-Aggregation1]link-aggregation mode dynamic二、华为设备链路聚合配置 静态链路聚合 SW1: [huawei-1]interface Eth-Ttunk 1 [huawei-1-Eth-Ttunk1]trunkport GigabitEthernet 1/0/1 to 1/0/6SW2: [huawei-2]interface Eth-Ttunk 1 [huawei-2-Eth-Ttunk1]trunkport GigabitEthernet 1/0/1 to 1/0/6 动态链路聚合 SW1: [huawei-1]interface Eth-Ttunk 1 [huawei-1-Eth-Ttunk1]mode lacpSW2: [huawei-2]interface Eth-Ttunk 1 [huawei-2-Eth-Ttunk1]mode lacp三、思科设备链路聚合配置 静态链路聚合 SW1: SW1(config)#interface port-channel 1 SW1(config)#interface range GigabitEthernet 1/0/1-6 SW1(config-if-range)#channel-group 1 mode onSW2: SW2(config)#interface port-channel 1 SW2(config)#interface range GigabitEthernet 1/0/1-6 SW2(config-if-range)#channel-group 1 mode on 动态链路聚合 SW1: SW1(config)#interface range GigabitEthernet 1/0/1-6 SW1(config-if-range)#channel-group 1 mode activeSW2: SW2(config)#interface range GigabitEthernet 1/0/1-6 SW2(config-if-range)#channel-group 1 mode active
-
zabbix5.0监控Linux主机 centos7.6为例 安装zabbix-agent2 curl -O https://mirrors.aliyun.com/zabbix/zabbix/5.4/rhel/7/x86_64/zabbix-agent2-5.4.9-1.el7.x86_64.rpm安装zabbix-agent2 rpm -ivh zabbix-agent2-5.4.9-1.el7.x86_64.rpm修改配置文件 Server=127.0.0.1改为自己的Zabbix服务器IP vi /etc/zabbix/zabbix_agent2.conf重启zabbix-agent2服务 systemctl restart zabbix-agent2开机自动启动zabbix-agent2 systemctl enable zabbix-agent2防火墙放行10050 firewall-cmd --zone=public --add-port=10050/tcp --permanent重载防火墙 firewall-cmd --reload然后去zabbix添加主机即可
-
Centos7.6安装zabbix5.0+mysql+nginx 安装wget yum install -y wgetcentos 7 添加阿里云镜像 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum install epel-release停止防火墙和SELinux systemctl stop firewalld && systemctl disable firewalld setenforce 0 sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config 卸载自带的mariadb yum remove mariadb mariadb-libs下载mysql5.7的repo wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm然后进行repo的安装 rpm -ivh mysql57-community-release-el7-9.noarch.rpm安装mysql yum install -y mysql-server 安装mysql时如果提示mysql-community-common-5.7.38-1.el7.x86_64.rpm 的公钥尚未安装 执行下面命令 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum -y install mysql-community-server目前只测试过centos7 MySQL5.7的环境 其他的并未测试 启动mysql5.7和设置开机启动 service mysqld start && chkconfig mysqld on查看临时密码 grep -an "temporary password" /var/log/mysqld.log登录MySQL mysql -u root -p 粘贴上方显示的临时密码 修改mysql的root密码为Zabbix@123.(这里遵从mysql默认密码级别 需要调整可自行百度) mysql> ALTER USER USER() IDENTIFIED BY 'Zabbix@123.'; mysql> flush privileges; mysql> quit;获取zabbix5.0安装源 rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm yum clean all安装Zabbix server and agent(下载慢或下载失败多试几遍,实在下不了可以去官网下rpm包) yum install -y zabbix-server-mysql zabbix-agent安装Zabbix frontend yum install -y centos-release-scl编辑配置文件 /etc/yum.repos.d/zabbix.repo激活zabbix-frontend的repo源 vim /etc/yum.repos.d/zabbix.repo 改为enabled=1这里使用nginx作为zabbix的前端(下载慢或下载失败多试几遍,实在下不了可以去官网下rpm包) yum install -y zabbix-web-mysql-scl zabbix-nginx-conf-scl创建初始数据库() mysql -uroot -pZabbix@123. mysql> create database zabbix character set utf8 collate utf8_bin; mysql> create user zabbix@localhost identified by 'Zabbix@123.'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> quit; 这里数据库和zabbix装在同一台,所以zabbix用户权限用的localhost 测试刚创建的数据库用户 mysql -uzabbix -pZabbix@123. show databases;导入初始架构和数据,系统将提示您输入新创建的密码,这里输入Zabbix@123.等待数据库导入完成 zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix测试导入是否成功 有表则全部倒入正常 mysql -uzabbix -pZabbix@123. show databases; use zabbix; show tables;) 为Zabbix server配置数据库 编辑配置文件 vim /etc/zabbix/zabbix_server.conf 将124行取消#号 并填写数据库密码 DBPassword=Zabbix@123.为Zabbix前端配置PHP 编辑配置文件 vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf 将第2第3行取消#号注释 这里注意一定不要使用默认的80端口 因为nginx默认使用/etc/opt/rh/rh-nginx116/nginx/nginx.conf然后才会使用/etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf 如果使用默认80端口访问是显示nginx默认欢迎页,需要使用域名访问,无法跳转至zabbix页面 这里使用8080端口 不使用域名 直接使用IP+端口形式访问 也可以配置自定义端口号编辑配置文件 vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf 第6行添加,nginx 最后一行去掉前面;号并修改时区为Asia/Shanghai启动Zabbix server和agent进程,并为它们设置开机自启: systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm页面访问: http://服务器IP:8080 按照页面提示一步一步操作 数据库密码填入上面设置的Zabbix@123. 其它使用默认配置即可 这里数据库和zabbix装在同一台,Database host使用localhost 如需外部访问可将host设置为服务器IP,port设置为3306(数据库账号zabbix的权限需要改成%) 使用默认配置即可 默认管理员账号密码为 Admin zabbix 登陆后切换为中文即可正常使用
-
华为清除配置命令及保存配置命令 一、清除整个交换机或路由器配置命令 在用户视图下执行reset saved-configuration,然后重启路由器即可。 在配置reset saved-configuration命令后,重启设备时请选择不保存当前配置文件。 清除和重新配置的信息只能在设备重新启动后生效,当前配置不变。 <HUAWEI>reset saved-configuration Warning: The action will delete the saved configuration on the device. The configuration will be erased to reconfigure.Continue? [Y/N]:y Warning: Now the configuration on the device is being deleted. Info: Succeeded in clearing the configuration on the device. <HUAWEI>reboot MPU 17: Next startup system software: cfcard:/VRPV200R005C10SPC607B607D0306_ce12800.cc Next startup saved-configuration file: NULL Next startup paf file: default Next startup patch package: NULL Warning: The current configuration will be saved to the next startup saved-configuration file. Continue? [Y/N]:n Warning: The system will reboot. Continue? [Y/N]:y二、save命令保存配置 <HUAWEI>save Warning: The current configuration will be written to the device. Continue? [Y/N]:y Info: Please input the file name(*.cfg, *.zip, *.dat):huawei.cfg Now saving the current configuration to the slot 17 Info: Save the configuration successfully.三、清除交换机或路由器某个端口地配置命令 <HUAWEI>system-view Enter system view, return user view with return command. [~HUAWEI]clear configuration interface GE 1/0/1 Warning: All running configurations of the interface will be cleared immediately. Continue? [Y/N]:y Info: Total 1 commands executed, 1 successful, 0 failed.
-
解决华为交换机删除VLan时报错:Error: The VLAN has a L3 interface. Please delete it first. 解决华为交换机 Error: The VLAN has a L3 interface. Please delete it first. 一、问题描述 当删除交换机的某个vlan时,有时会报上述错误Error: The VLAN has a L3 interface. Please delete it first. 二、解决方法 首先查看该vlanif接口是否绑定ip地址(以vlan40为例) [Huawei]int vlan 40 [Huawei-Vlanif40]dis this # interface Vlanif40 # return得到上述结果说明该虚接口没有配置ip地址,则退出该接口模式 若该接口配置了IP地址则使用下面命令删除该IP地址 [Huawei-Vlanif40]undo ip address此时则退出接口模式,再次尝试删除该vlan:undo vlan 40 若该接口没有绑定IP地址 使用下面命令 [Huawei]undo interface Vlanif 40再次尝试删除vlan:undo vlan 40, 此时就可以正常删除
-
华为交换机:配置telnet和ssh、web访问 华为配置telnet和ssh访问 一、Telnet登陆配置 1、配置telnet功能及参数 <Huawei>system-view # 进入系统视图 [Huawei]telnet server enable # 配置开启telnet(默认开启) [Huawei]telnet server port 23 # 配置telnet端口(默认为23)2、配置telnet用户登陆界面 [Huawei]user-interface vty 0 4 # 进入vty用户界面视图 [Huawei-ui-vty0-4]protocol inbound telnet # 配置用户界面支持Telnet服务 [Huawei-ui-vty0-4]user privilege level 3 # 配置用户级别,3为管理级,最高权限3、配置验证方式 三种输入的验证方式: none: 无需验证 password: 用户密码验证 aaa: AAA验证,即用户名和密码验证 我们只需要在这三种验证方式中选择一种即可。一般选择C。 A. 配置不验证密码 [Huawei-ui-vty0-4]authentication-mode noneB. 配置passwd验证方式 [Huawei-ui-vty0-4]authentication-mode password #配置验证方式为password [Huawei-ui-vty0-4]set authentication password cipher Huawei123 #配置验证密码:Huawei12#$C. 配置AAA验证 [Huawei-ui-vty0-4] authentication-mode aaa #配置验证模式为aaa [Huawei-ui-vty0-4] quit #退出用户界面视图 [Huawei] aaa #进入aaa验证 [Huawei-aaa] local-user admin password cipher Huawei12#$ #设置登陆用户名为admin,密码为Huawei12#$ [Huawei-aaa] local-user admin privilege level 3 #配置用户级别 [Huawei-aaa] local-user admin service-type telnet #配置用户登录方式 [Huawei-aaa] quit用户登陆级别说明 0参观级:网络诊断工具命令(ping、tracert)、从本设备出发访问外部设备的命令(Telnet客户端)、部分display命令等。 1监控级:用于系统维护,包括display等命令。并不是所有display命令都是监控级,比如display current-configuration命令和display saved-configuration命令是3级管理级。 2配置级:业务配置命令,包括路由、各个网络层次的命令,向用户提供直接网络服务。 3~15管理级:用于系统基本运行的命令,对业务提供支撑作用,包括文件系统、FTP、TFTP下载、命令级别设置命令以及用于业务故障诊断的debugging命令等。 4、配置Telnet远程登陆管理端口 远程管理端口可以是物理端口或者逻辑端口 设置物理管理端口 [Huawei] interface MEth 0/0/1 [Huawei-MEth0/0/1] ip address 192.168.1.250 24 [Huawei-MEth0/0/1] quit设置逻辑端口 [Huawei] vlan 10 ... [Huawei] interface vlanif 10 [Huawei-vlanif10] ip address 192.168.10.1 24 [Huawei-vlanif10] quit说明:必须保证控制终端能够连接上交换机的vlanif10端口,特别是控制端直接连接此设备时,还需要将与控制端相连的设备端口配上相应的vlan,如控制端连接GigabitEthernet0/0/1来对设备进行远程登陆,需要的配置如下: [Huawei] interface gigabitethernet0/0/1 [Huawei-GigabitEthernet0/0/1] port link-type access [Huawei-GigabitEthernet0/0/1] port default vlan 10 [Huawei-GigabitEthernet0/0/1] quit二、配置SSH远程登陆 1.配置SSH远程登陆界面及其属性 <Huawei> system-view [Huawei] user-interface vty 0 4 [Huawei-ui-vty0-4] authentication-mode aaa # 配置用户界面验证方式 [Huawei-ui-vty0-4] protocal inbound ssh # 配置用户界面支持SSH [Huawei-ui-vty0-4] user privilege level 5 # 配置用户界面优先级 [Huawei-ui-vty0-4] quit 配置SSH服务 [Huawei] stelnet server enable #使能STelnet服务 [Huawei] ssh user radmin service-type stelnet #配置SSH用户radmin的服务方式为STelnet [Huawei] ssh user radmin authentication-type password #配置用户名为radmin(新建)的SSH用户 配置AAA验证所需的用户名和密码 [Huawei] aaa [Huawei-aaa] local-user radmin password cipher Huawei12#$ #配置用户'radmin'(新建)及其密码'Huawei12#$' [Huawei-aaa] local-user radmin privilege level 10 #配置用户优先级 [Huawei-aaa] local-user radmin service-type ssh #配置本地用户接入类型为SSH [Huawei-aaa] quit 说明:当用户界面优先级和用户本身的优先级(AAA视图下的配置)相冲突,以用户优先级为准 配置SSH远程登陆管理端口 管理端口的配置根Telnet服务一致,不再重复。 管理终端登陆 ssh radmin@192.168.100.1三、web页面登陆配置步骤 配置步骤: system-view [HUAWEI]http server enable #开启http服务 [HUAWEI]interface vlanif 1 [HUAWEI-Vlanif1]ip add 192.168.1.1 255.255.255.0 #配置IP地址 [HUAWEI-Vlanif1]quit [HUAWEI]aaa [HUAWEI-aaa]local-user huawei password cipher huawei@123 #配置用户名huawei和密码huawei@123 [HUAWEI-aaa]local-user huawei privilege level 15 #配置用户名权限 [HUAWEI-aaa]local-user huawei service-type http #配置用户名服务类型 [HUAWEI-aaa]quit [HUAWEI]quit save y重点华为设备出厂的时候,对web访问的接口做了限制,我们必须查出来哪个接口可以web访问 display current-configuration filter http serve #查询哪个接口允许web访问 # post-system http server enable http server permit interface GigabitEthernet0/0/1 #这个接口可以访问 # return解决办法有两种: undo http server permit interface #删除限制 http server permit interface e0/0/0 #允许你的接口访问web 坑坑坑 在这里我想说的是,华为的web界面真的是很差,我用的真机S5700,不知道新版的怎么样。配置web界面后一直处在加载中,估计是web版本的问题或者浏览器的问题,建议还是用命令吧,目前这个坑还不知道怎么解决,有解决办法再补上。