脚本内容: #!/bin/bash # ens=$(cat /proc/net/dev | awk '{if($2>0 && NR > 2) print substr($1, 0, index($1, ":") - 1)}' | grep "^e[a-z,0-9].*") ensurl=$"/etc/sysconfig/network-scripts/ifcfg-$ens" sed -i 's/BOOTPROTO=[a…
ping /bin/ping语法:ping [选项] IP地址 选项:-c 指定发送次数功能描述:测试网络连通性 ping -c 4 192.168.1.101 关闭防火墙systemctl stop firewalld.service systemctl disable firewalld.servicesystemctl status firewalld.service ifconfig /sbin/ifconfig interface configure 执行权限:root语法:ifcon…
@echo off cls ::set NAME="本地连接" set NAME="无线网络连接" set IP=192.168.1.55 set MASK=255.255.255.0 set GATEWAY=192.168.1.1 set DNS1=42.120.21.30 set DNS2=114.114.114.114 echo. echo 自动获取IP 请按 1 echo. echo 手动设置IP 请按 2 set /p KEY= [您的选择是:] if %…
须知: 防火墙配置文件:/etc/sysconfig/iptables 查看防火墙状态:service iptables status 关闭防火墙:service iptables stop 关闭iptalbes:chkconfig iptables off 查看那SELinux状态:getenforce SELinux配置文件:/etc/selinux/config ****************************************************************…
#!/bin/bash IFO() { read -p "Configure $line Network card ( 'yes'or'no' )?" CDN </dev/tty if [ "${CDN}" == yes ];then ADD_D else echo "quiting" exit fi } NET_W() { while :;do STR=`cat /etc/udev/rules.d/70-persistent-net.ru…
关闭防火墙 SELINUX=disabled 可以是三种状态 # enforcing - SELinux security policy is enforced.打开# permissive - SELinux prints warnings instead of enforcing.打开不拦截# disabled - No SELinux policy is loaded.关闭,默认 selinux在打开状态下,可以使用下面两个命令 第一个命令是查询selinux的状态,处于关闭状态. 第二个…
桥接模式,给一台物理机,有自己独立的IP. boot分区,引导分区,系统启动,内核文件. swap分区,内存扩展分区.1.5或2倍.内存不够的时候,会写入其中.正常给8G或者16G就够了.不需要非要1.5或2倍. / 根.所有文件的根. 腾讯课堂毕业证颁发的证书,跟大学毕业证一样是所有企业都认可的. 知识面,决定你有没有思路.当你一切方法都解决不了问题的时候,从内核出发,一定能解决问题. 一个月拿个4,5千,确实不应该是一个男人拿的薪资.--MK Ctrl+L 清屏 nmtui 管理网卡(确保是…
Centos 7设置静态IP # vi /etc/sysconfig/network-scripts/ifcfg-enxxx BOOTPROTO="static" ...... IPADDR="192.168.1.xxx" #要分配给机器的静态IP地址 因为是在虚拟机中,所以我设置成与我的机器同一网段 GATEWAY="192.168.1.xxx" #网关 设置为与自己机器相同就可以了 NETMASK="255.255.255.0&qu…
关闭防火墙: service NetworkManager stop --图形化用ifconfig之前先关掉网络服务. chkconfig NetworkManager off (将开机自启动关掉,使开机后也不启动.) NetworkManager是默认开机自启动,需关掉.  没图形化上面两步不用执行. service iptables stop   chkconfig iptables off (在6里是iptables ,7里是firewalld) service ip6tables sto…
确认当前网络配置: [root@localhost ~]# nmcli -p dev ===================== Status of devices ===================== DEVICE TYPE STATE CONNECTION ------------------------------------------------------------------ virbr0 bridge connected virbr0 eth0 ethernet conn…
针对新安装或者克隆后的虚拟机配置 1. 设置hostname 方法1: centos7 里面修改hostname的方式有所改变,修改/etc/hosts和/etc/sysconfig/network两个文件已经不能生效.使用的新命令是: [root@hadoop101 mort]# hostnamectl set-hostname hadoop101.com [root@hadoop101 mort]# hostname -f hadoop101.com 方法2: 修改配置文件/etc/host…
suse-linux:~ # cat /etc/issue Welcome to SUSE Linux Enterprise Server 12 SP3 (x86_64) - Kernel \r (\l). suse-linux:~ # uname -a Linux suse-linux 4.4.73-5-default #1 SMP Tue Jul 4 15:33:39 UTC 2017 (b7ce4e4) x86_64 x86_64 x86_64 GNU/Linux suse-linux:~…
本次内容包括Linux:ip.主机名.关闭firewalld与selinux 开机临时生效和永久生效 ------------------------------------------------------- ip 临时生效:ifconfig eno16777736 192.168.100.31/24 up 永久生效:cd /etc/sysconfig/network-scripts/ vi /网卡            #形如 vi eno167777136  IPADDR=192.168…
使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfig iptables on 永久开启防火墙 关闭SELinux: 编辑/etc/sysconfig/selinux文件 设置:SELINUX=disabled…
临时关闭selinux: setenforce 0    //设置SELinux 成为permissive模式 彻底禁用selinux: 使用root用户,vim /etc/sysconfig/selinux,将SELINUX=enforcing修改成SELINUX=disabled. 重启后才能生效. 临时关闭防火墙: service iptables stop 永久关闭防火墙: chkconfig iptables off…
在vmware下安装centos6.5通过桥接方式访问外网,因此需要配置ip. 一.ip配置 1.1. 配置动态ip vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0   HWADDR=00:0C:29:E1:E4:8E TYPE=Ethernet UUID=f271bf73-7d8f-448f-8e8b-71c39eb13509 ONBOOT=yes(重要被启用) NM_CONTROLLED=yes BOOTPROTO=dhcp(…
一.关闭防火墙 centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的. 所以你只要停止firewalld服务即可:sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service 如果你要改用iptables的话,需要安装iptables服务:sudo yum install iptables-ser…
关闭防火墙 1)重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 验证防火墙是否关闭:chkconfig --list |grep iptables 2) 即时生效,重启后失效 开启: service iptables start 关闭: service iptables stop centos 7: systemctl stop firewalld.service #停止 systemctl disable firewalld…
查看防火墙状态.systemctl status firewalld 临时关闭防火墙命令.重启电脑后,防火墙自动起来.systemctl stop firewalld 永久关闭防火墙命令.重启后,防火墙不会自动启动.systemctl disable firewalld 打开防火墙命令.systemctl enable firewalld 防火墙开放特定端口:①文件/etc/sysconfig/iptables②添加:-A RH-Firewall-1-INPUT -m state –state…
两种方法手动修改IP: 命令行方式 2. 图形化界面修改 点击应用即可(地址自行设置) 关闭防火墙服务,否则连不上Linux…
CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下. 1.关闭防火墙 [root@localhost ~]# systemctl stop firewalld.service 2.禁止防火墙开机自启 [root@localhost ~]# systemctl disable firewalld.service 3.安装iptables service yum -y install iptables-services 4.修改防火墙配置,如增加防火…
1)关闭防火墙(每个节点) [Bash shell] 1 2 service iptables stop chkconfig iptables off 2)关闭selinux(重启生效) [Bash shell] 1 vim /etc/selinux/config…
CentOS 7.0默认使用的是firewall作为防火墙 直接关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 重启:shutdown -r now ← 立刻关闭系统并重启 关闭selinux Redhat应用了SELinux去加强平安,永久封闭的举措为: 修改 /etc/selinux/config 文件中的 SELINUX=""…
从技术角度来分析,几个要求: 1.从安全方面看,sftp会更安全一点 2.线上服务器提供在线服务,对用户需要控制,只能让用户在自己的home目录下活动 3.用户只能使用sftp,不能ssh到机器进行操作   提供sftp服务,可以用系统自带的internal-sftp,也可以使用vsftpd,这里需求不多,直接选用internal-sftp.   限制用户只能在自己的home目录下活动,这里需要使用到chroot,openssh 4.8p1以后都支持chroot,我现在用的是CentOS 6.3…
查看防火墙状态 iptables -L or service iptables status 临时性关闭防火墙 iptables -F or service iptables stop 永久性关闭防火墙 chkconfig iptables off #重启生效 iptables -Fservice iptables save 关闭Selinux 修改配置文件为disabled,重启 /etc/selinux/config 或者 /etc/sysconfig/selinux 后者就是前者的连接文件…
由于办公室网络需要固定IP和DNS才能上网, 在连接公共网络或者家里又需要自动获取IP和DNS才能上网. 频繁手动切换很麻烦,就搞了两个脚本一键设置. 1.新建文本文件, 命名为固定IP.bat 复制脚本 (如果你知道怎么选编码格式的话选择ANSI) @echo //-=-=-=-=-=-=-=-=-=-=-=-=-=-= @echo // [固定设置] @echo // 设置IP,子网掩码,网关 @echo //-=-=-=-=-=-=-=-=-=-=-=-=-=-= %1 mshta vbs…
本文将简单介绍在CentOS7上如何临时和永久关闭防火墙和selinux. 关闭防火墙 # 查看防火墙状态 [root@localhost ~]# systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset:…
一.关闭防火墙 1. 先查看防火墙状态 [root@bogon ~]# 1 systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled) Active: active (running) since 一 2015-05-25 22:53:54 CST; 3mi…
一.准备工作 1.1.服务器准备 操作系统:centos 7.x 1.2.安装好用的文本编辑工具nano # yum -y install nano 二.关闭SELinux 2.1.查看SELinux状态 2.1.1.第一种:查看SELinux状态方法 # /usr/sbin/sestatus SELinux status:                 enabled SELinuxfs mount:                /sys/fs/selinux SELinux root d…
[修改机器名] # vi /etc/hostname [关SELinux] # vi /etc/selinux/config设置SELINUX=disabled [关防火墙] # systemctl stop firewalld# systemctl disable firewalld# systemctl status firewalld 看状态firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/us…