记录了 CentOS 最小化安装后如何配置和连接无线网络,当时的情况是路由器使用的WEP加密方式,所以设置密码的时候可以直接使用明文密码。后来当把路由器的加密模式设置为 WPA/WPA2-PSK的时候,发现已经无法连接无线网络了,原因是当使用 WPA/WPA2-PSK 加密模式之后客户端不能直接发送明文密码,而是要使用加密之后的密码,既然我们知道了原因我们该怎么做呢?
首先我们要安装一个帮我们生成加密密码并配置网卡的工具包 wpa_supplicant
yum install -y wpa_supplicant
然后找到我们路由的 ESSID,比如我是 long,然后生成密码配置文件,
wpa_passphrase long 'my password'
它会输出如下内容
network={ ssid="long" #psk="my password" psk=350fb537ccec9b6de427eb4a43b7e02ae0492a59ce0a095ac6b527aef2c40f94 }
将输入的内容追加到 /etc/wpa_supplicant/wpa_supplicant.conf
或者直接执行
wpa_passphrase long 'my password' >> /etc/wpa_supplicant/wpa_supplicant.conf
再把其中 ssid= 和 psk= 加入到wlan0 的配置文件,或执行一下命令
wpa_passphrase long 'my password' | grep -v '{\|}' >> /etc/sysconfig/network-scripts/ifcfg-wlan0 echo 'WPA=yes' >> /etc/sysconfig/network-scripts/ifcfg-wlan0
我的配置文件内容如下:
DEVICE=wlan0 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=192.168.1.5 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 WPA=yes SSID="long" PSK=350fb537ccec9b6de427eb4a43b7e02ae0492a59ce0a095ac6b527aef2c40f94
然后,我们可以启动网络设备
ifup wlan0
再启动 wpa_supplicant
wpa_supplicant -iwlan0 -B -c /etc/wpa_supplicant/wpa_supplicant.conf
我们需要随机启动的话,加入到 /etc/rc.local
cat >> /etc/rc.local<<EOF wpa_supplicant -iwlan0 -B -c /etc/wpa_supplicant/wpa_supplicant.conf EOF
==================================================================================
以上是来自网上的一篇文章
我的路由器的配置信息:
无线的加密设置
/etc/sysconfig/network-scripts/ifcfg-wlan0文件的内容:
DEVICE=wlan0 HWADDR=84:A6:C8:E6:37:6E TYPE=Ethernet UUID=2393dafa-31ff-4a66-b00d-51af7ebfb9c1 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp WPA=yes SSID="junjin.mai" PSK=742af11ddda680defba6e1c2b20ea04529f20edf7972f869d613c651d9cb9335
/etc/wpa_supplicant/wpa_supplicant.conf文件的内容
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel network={ ssid="junjin.mai" proto=WPA2 key_mgmt=WPA-PSK #请无论你是使用WPA-PSK,WPA2-PSK,都请在这里输入 WPA-PSK。这在wpa_supplicant看来WPA-PSK,WPA2-PSK都是 WPA-PSK,改成WPA2-PSK,它会不认识 。 pairwise=CCMP #psk="junjin.mai123;" psk=742af11ddda680defba6e1c2b20ea04529f20edf7972f869d613c651d9cb9335 }
/etc/rc.local文件的内容
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local wpa_supplicant -iwlan0 -B -c /etc/wpa_supplicant/wpa_supplicant.conf ifup wlan0
相关推荐
/ # usb 1-1: new full speed USB device using s3c2410-ohci and address 2 usb 1-1: device descriptor read/64, error -62 usb 1-1: device descriptor read/64, error -62 usb 1-1: new full speed USB device ...
# CentOS-7-x86_64-NetInstall-1810.iso CentOS 7.6 网络安装版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-NetInstall-1810.iso # CentOS7.5 下载地址 # CentOS-7-x86_64-DVD-...
consol/centos-xfce-vnc 采用VNC或者浏览器 firefox/chrome 都可以连接。启动命令: docker run --rm -it -p 5901:5901 -p 6901:6901 --name test_cent_os consol/centos-xfce-vnc。默认密码 vncpassword
主要介绍了CentOS 安装软件出现错误:/lib/ld-linux.so.2: bad ELF interpreter 解决的相关资料,需要的朋友可以参考下
# CentOS-7-x86_64-DVD-1810.iso CentOS 7.6 DVD 版 4G http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # CentOS-7-x86_64-Everything-1810.iso CentOS 7.6 Everything版 10G ...
下载后,上传到centos中,执行如下命令:rpm -Uvh ./*.rpm --nodeps --force
解决Centos6.7:-bash: ./DrClientLinux: /lib/ld-linux.so.2: bad ELF 的所有rpm包
CentOS 7.X版本专用 升级命令: rpm -Uvh polkit-0.112-26.el7_9.1.x86_64.rpm 参考链接: https://ubuntu.com/security/CVE-2021-4034 https://access.redhat.com/security/cve/CVE-2021-4034 ...
打开centos的yum文件夹 输入命令cd /etc/yum....当前目录是/etc/yum.repos.d/,刚刚下载的Centos-7.repo也在这个目录上 备份 [root@bogon ~]# cd /etc/yum.repos.d/ [root@bogon yum.repos.d]# mkdir repo_bak [ro
CentOS 6.X版本专用 升级命令: rpm -Uvh polkit-0.96-11.el6_10.2.x86_64.rpm 或yum localinstall -y polkit-0.96-11.el6_10.2.x86_64.rpm 参考链接: https://ubuntu.com/security/CVE-2021-4034 ...
CentOS7下安装搭建Redis-4.0.6的详细过程,有具体的截图说明过程。其中还包含Redis客户端是在Win下搭建,可以连接Redis服务,实现程序测试查看。 tar.gz、exe等包已经包含
VMware界面最上面,选择虚拟机->设置:将网络连接改为桥接模式,如下图所示: 二、查看主机DNS地址 win+R 输入cmd,启动命令行界面,输入ipconfig/all,查看主机DNS服务器地址,如下图所示: 注意,由于本机是...
linux镜像文件iso下载 部分链接: Ubuntu22.10: ...Ubuntu Mate 22.10: ...CentOS 9 stream: https://mirrors.cnnic.cn/centos-stream/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso
autogen-5.18-5.el7.x86_64.rpm cpp-4.8.5-36.el7.x86_64.rpm gcc-4.8.5-36.el7.x86_64.rpm glibc-devel-2.17-260.el7.x86_64 ...下载后,上传到centos中,执行如下命令:rpm -Uvh ./*.rpm --nodeps --force
2、启用Jenkins存储库。运行以下命令下载并导入GPG密钥 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo sudo rpm –import https://jenkins-ci.org/
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget ...
CentOS-6.2镜像共两张DVD1和DVD2,安装操作系统只用DVD1即可 镜像下载地址: 32位DVD1http://mirrors.163.com/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD1.iso 32位DVD2...
kernel-3.10.0-327.el7.x86_64.rpm 源下载地址:https://buildlogs.centos.org/c7.1511.00/kernel/20151119220809/3.10.0-327.el7.x86...没有积分的就去下源地址的吧,网络不好的就花点积分下载我的吧,我也是找了半天
oracle官网已不开放下载,亲测可用,jdk1.7 linux centos,提供多版本