精华内容
下载资源
问答
  • 无论在什么操作系统中,都可能会涉及到WiFi信号的接入,然后系统就会把用户输入的WiFi密码记录起来,在Linux查看WiFi SSID密码比起Windows系统中要方便很多,其实也就是一条命令的事。Linux查看WiFi SSID密码的方法...

    无论在什么操作系统中,都可能会涉及到WiFi信号的接入,然后系统就会把用户输入的WiFi密码记录起来,在Linux查看WiFi SSID密码比起Windows系统中要方便很多,其实也就是一条命令的事。

    Linux查看WiFi SSID密码的方法:

    方法一、使用终端命令获取WiFi无线密码:

    1、打开「终端」— 进入如下位置:

    01cd /etc/NetworkManager/system-connections

    复制代码

    cd /etc/NetworkManager/system-connections

    2、此目录中存储了网络连接详细信息的配置文件,可以使用 ls 命令列出所有 WiFi 连接配置文件。

    3、使用 cat 命令查看 Linux 中已保存的 WiFi 配置文件,在 WiFi-Security 段的 psk 位置可以查看到无线密码。

    方法二、使用Ubuntu GUI恢复无线密码:

    1、点击右上角的 WIFI 图标,在下拉菜单中选择「编辑连接」选项。

    2、在打开的「网络连接」界面中,可以看到 Wi-Fi、蓝牙和以太网共 3 个选项。你可以在 Wi-Fi 选项下看到所有已保存的网络连接。选择要查看密码的连接名称—点击「编辑」按钮。

    3、在弹出的菜单中选择「Wi-Fi安全性」选项卡—勾选「显示密码」按钮即可查看到已保存的 WiFi 密码。

    以上步骤便是Linux查看WiFi SSID密码的方法,用户可以根据不同的系统环境来选择其中一种方法查看WiFi密码。

    展开全文
  • i使用Nmcli命令Linux终端连接WiFilinux系统中有几种用于管理无线网络接口的命令行工具。 其中的一些可用于简单查看无线网络接口状态(无论是启动还是关闭 ,或者是否连接到任何网络),如iw , iwlist , ip , ...

    i使用Nmcli命令从Linux终端连接WiFi

    在linux系统中有几种用于管理无线网络接口的命令行工具。 其中的一些可用于简单查看无线网络接口状态(无论是启动还是关闭 ,或者是否连接到任何网络),如iw , iwlist , ip , ifconfig等。

    其中一些用于连接无线网络,其中包括: nmcli ,是用于创建,显示,编辑,删除,启用和禁用网络连接以及控制和显示网络设备状态的命令行工具。

    首先使用以下命令检查网络设备的名称。 从该命令的输出中,设备名称/接口是wlp1s0 ,如图所示。

    $ iw dev phy#0

    Interface wlp1s0 ifindex 3 wdev 0x1 addr 38:b1:db:7c:78:c7

    type managed

    接下来,使用以下命令检查Wi-Fi设备连接状态。

    iw wlp2s0 link

    Not connected.

    从设备上方的输出未连接到任何网络,请运行以下命令扫描可用的Wi-Fi网络。

    sudo iw wlp2s0 scan

    command failed: Network is down (-100)

    考虑到上述命令的输出,网络设备/接口处于DOWN状态 ,您可以使用ip命令将其打开 (UP ),如图所示。

    $ sudo ip link set wlp1s0 up

    如果出现以下错误,这意味着您的Wifi在笔记本电脑或计算机上很难被屏蔽。

    RTNETLINK answers: Operation not possible due to RF-kill

    要删除或取消阻止,您需要运行以下命令来解决错误。

    $ echo "blacklist hp_wmi" | sudo tee /etc/modprobe.d/hp.conf

    $ sudo rfkill unblock all

    然后尝试再次打开网络设备,并且这次应该可以工作。

    $ sudo ip link set wlp1s0 up

    如果您知道要连接的Wi-Fi网络的ESSID ,请转至下一步,否则请发出以下命令以再次扫描可用的Wi-Fi网络。

    $ sudo iw wlp1s0 scan

    最后,使用以下命令连接到Wi-Fi网络,其中Hackernet (Wi-Fi网络SSID)和localhost22 (密码/预共享密钥)。

    $ nmcli dev wifi connect Hackernet password localhost22

    连接后,通过对外部计算机执行ping操作来验证连接,并如图所示分析ping的输出。

    $ ping 8.8.8.8** PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

    64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=61.7 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=61.5 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=61.6 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=61.3 ms 64 bytes from 8.8.8.8: icmp_seq=5 ttl=48 time=63.9 ms ^C --- 8.8.8.8 ping statistics ---

    5 packets transmitted, 5 received, 0% packet loss, time 4006ms rtt min/avg/max/mdev = 61.338/62.047/63.928/0.950 ms

    而已! 我希望这篇文章能帮助你从Linux命令行设置你的Wi-Fi网络。 与往常一样,如果您发现这篇文章有用,请在下面的评论部分分享您的想法。

    展开全文
  • 1、iwconfigiwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部 分。目前很多无线网卡都支持LWE,而且主流的...

    1、iwconfig

    iwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部 分。目前很多无线网卡都支持LWE,而且主流的Linux发布版本,比如Redhat Linux、Ubuntu Linux都已经带了这个配置工具。

    用法: iwconfig interface [essid {NN|on|off}]

    [nwid {NN|on|off}]

    [mode {managed|ad-hoc|...}

    [freq N.NNNN[k|M|G]]

    [channel N]

    [ap {N|off|auto}]

    [sens N]

    [nick N]

    [rate {N|auto|fixed}]

    [rts {N|auto|fixed|off}]

    [frag {N|auto|fixed|off}]

    [enc {NNNN-NNNN|off}]

    [power {period N|timeout N}]

    [retry {limit N|lifetime N}]

    [txpower N {mW|dBm}]

    [commit]

    说明:iwconfig是LWE最主要的工具,可以对无线网卡的大部分参数进行配置。

    参数:

    essid: 设置无线网卡的ESSID(Extension Service Set ID)。通过ESSID来区分不同的无线网络,正常情况下只有相同ESSID的无线站点才可以互相通讯,除非想监听无线网络。其后的参数为双引号括起的 ESSID字符串,或者是any/on/off,如果ESSID字符串中包含any/no/off,则需要在前面加"--"。

    示例:

    #iwconfig eth0 essid any 允许任何ESSID,也就是混杂模式

    #iwconfig eth0 essid "My Network" 设置ESSID为"My Network"

    #iwconfig eth0 essid -- "ANY" 设置ESSID为"ANY"

    nwid: Network ID,只用于pre-802.11的无线网卡,802.11网卡利用ESSID和AP的MAC地址来替换nwid,现在基本上不用设置。

    示例:

    #iwconfig eth0 nwid AB34

    #iwconfig eth0 nwid off

    nick: Nickname,一些网卡需要设置该参数,但是802.11协议栈、MAC都没有用到该参数,一般也不用设置。

    示例:

    #iwconfig eth0 nickname "My Linux Node"

    mode:设置无线网卡的工作模式,可以是

    Ad-hoc:不带AP的点对点无线网络

    Managed:通过多个AP组成的网络,无线设备可以在这个网络中漫游

    Master:设置该无线网卡为一个AP

    Repeater:设置为无线网络中继设备,可以转发网络包

    Secondary:设置为备份的AP/Repeater

    Monitor:监听模式

    Auto:由无线网卡自动选择工作模式

    示例:

    #iwconfig eth0 mode Managed

    #iwconfig eth0 mode Ad-Hoc

    freq/channel: 设置无线网卡的工作频率或者频道,小于1000的参数被认为是频道,大于10000的参数被认为是频率。频率单位为Hz,可以在数字后面附带k, M, G来改变数量级,比如2.4G。频道从1开始。使用lwlist工具可以查看无线网卡支持的频率和频道。参数off/auto指示无线网络自动挑选频率。

    注意:如果是Managed模式,AP会指示无线网卡的工作频率,因此该设置的参数会被忽略。Ad-hoc模式下只使用该设定的频率初始无线网络,如果加入已经存在的Ad-hoc网络则会忽略该设置的频率参数。

    示例:

    #iwconfig eth0 freq 2422000000

    #iwconfig eth0 freq 2.422G

    #iwconfig eth0 channel 3

    #iwconfig eth0 channel auto

    ap: 连接到指定的AP或者无线网络,后面的参数可以是AP的MAC地址,也可以是iwlist scan出来的标识符。如果是Ad-hoc,则连接到一个已经存在的Ad-hoc网络。使用off参数让无线网卡不改变当前已连接的AP下进入自动模式。 any/auto参数,无线网卡自动选择最好的AP。

    注意:如果无线信号低到一定程度,无线网络会进入自动选择AP模式。

    示例:

    #iwconfig eth0 ap 00:60:1D:01:23:45

    #iwconfig eth0 ap any

    #iwconfig eth0 ap off

    rate/bit: 如果无线网卡支持多速率,则可以通过该命令设置工作的速率。小于1000的参数由具体的无线网卡驱动定义,一般是传输速率的索引值,大于1000的为速 率,单位bps,可以在数字后面附带k, M, G来指定数量级。auto参数让无线网卡自动选择速率fixed参数让无线网卡不使用自动速率模式。

    示例:

    #iwconfig eth0 rate 11M

    #iwconfig eth0 rate auto

    #iwconfig eth0 rate 5.5M auto //自动选择5.5M以下的速率

    txpower:如果无线网卡支持多发射功率设定,则使用该参数设定发射,单位为dBm,如果指定为W(毫瓦),只转换公式为:

    dBm=30+log(W)。参数on/off可以打开和关闭发射单元,auto和fixed指定无线是否自动选择发射功率。

    示例:

    #iwconfig eth0 txpower 15

    #iwconfig eth0 txpower 30mW

    #iwconfig eth0 txpower auto

    #iwconfig eth0 txpower off

    sens:设置接收灵敏度的下限,在该下限之下,无线网卡认为该无线网络信号太差,不同的网卡会采取不同的措施,一些现代的无线网卡会自动选择新的AP。正的参数为raw data,直接传给无线网卡驱动处理,一般认为是百分比。负值表示dBm值。

    示例:

    #iwconfig eth0 sens -80

    #iwconfig eth0 sens 2

    retry: 设置无线网卡的重传机制。limit ‘value’ 指定最大重传次数;lifetime ‘value’指定最长重试时间,单位为秒,可以附带m和u来指定单位为毫秒和微秒。如果无线网卡支持自动模式,则在limit和lifetime之前还 可以附加min和max来指定上下限值。

    示例:

    #iwconfig eth0 retry 16

    #iwconfig eth0 retry lifetime 300m

    #iwconfig eth0 retry min limit 8

    rts:指定RTS/CTS握手方式,使用RTS/CTS握手会增加额外开销,但如果无线网络中有隐藏无线节点或者有很多无线节点时可以提高性能。

    后面的参数指定一个使用该机制的最小包的大小,如果该值等于最大包大小,则相当于禁止使用该机制。可以使用auto/off/fixed

    参数。

    示例:

    #iwconfig eth0 rts 250

    #iwconfig eth0 rts off

    frag:设置发送数据包的分片大小。设置分片会增加额外开销,但在噪声环境下可以提高数据包的到达率。一般情况下该参数小于最大包大小,有些支持Burst模式的无线网卡可以设置大于最大包大小的值来允许Burst模式。还可以使用auto/fixed/off参数。

    示例:

    #iwconfig eth0 frag 512

    #iwconfig eth0 frag off

    key/enc[ryption]:设置无线网卡使用的加密密钥,此处为设置WEP模式的加密key,如果要使用WPA,需要wpa_supplicant工具包。

    密 钥参数可以是 XXXX-XXXX-XXXX-XXXX 或者 XXXXXXXX 格式的十六进制数值,也可以是s:xxxxxx的ASCII字符。如果在密钥参数之前加了[index],则只是设置该索引值对应的密钥,并不改变当前的 密钥。直接指定[index]值可以设置当前使用哪一个密钥。指定on/off可以控制是否使用加密模式。open/restricted指定加密模式, 取决于不同的无线网卡,大多数无线网卡的open模式不使用加密且允许接收没有加密的数据包,restricted模式使用加密。可以使用多个key参 数,但只有最后一个生效。

    WEP密钥可以是40bit,用10个十六进制数字或者5个ASCII字符表示,也可以是128bit,用26个十六进制数字或者13个ASCII字符表

    示。

    示例:

    #iwconfig eth0 key 0123-4567-89

    #iwconfig eth0 key [3] 0123-4567-89

    #iwconfig eth0 key s:password [2]

    #iwconfig eth0 key [2]

    #iwconfig eth0 key open

    #iwconfig eth0 key off

    #iwconfig eth0 key restricted [3] 0123456789

    #iwconfig eth0 key 01-23 key 45-67 [4] key [4]

    power:设置无线网卡的电源管理模式。period ‘value’ 指定唤醒的周期,timeout ‘value’指定进入休眠的等待时间,这两个参数之前可以

    加min和max修饰,这些值的单位为秒,可以附加m和u来指定毫秒和微秒。off/on参数指定是否允许电源管理,all/unicast/multicast

    指定允许唤醒的数据包类型。

    示例:

    #iwconfig eth0 power period 2

    #iwconfig eth0 power 500m unicast

    #iwconfig eth0 power timeout 300u all

    #iwconfig eth0 power off

    #iwconfig eth0 power min period 2 power max period 4

    commit:提交所有的参数修改给无线网卡驱动。有些无线网卡驱动会先缓存无线网卡参数修,使用这个命令来让无线网卡的参数修改生效。不过一般不需要使用该命令,因为无线网卡驱动最终都会是参数的修改生效,一般在debug时会用到。

    -----------

    iwlist eth1 scan 搜索无线网络:

    显示搜到的网络(此处只显示一个):

    eth1 Scan completed :

    Cell 01 - Address: 00:04:E2:E3:04:FC

    ESSID:"ap_demo"

    Mode:Managed

    Frequency:2.437 GHz

    Quality:0/0 Signal level=-61 dBm Noise level=-96 dBm

    Encryption key:on

    Bit Rate:1 Mb/s

    Bit Rate:2 Mb/s

    Bit Rate:5.5 Mb/s

    Bit Rate:11 Mb/s

    Bit Rate:6 Mb/s

    Bit Rate:9 Mb/s

    Bit Rate:12 Mb/s

    Bit Rate:18 Mb/s

    Bit Rate:24 Mb/s

    Bit Rate:36 Mb/s

    Bit Rate:48 Mb/s

    Bit Rate:54 Mb/s

    Cell 02 ……

    ---------------

    设置板子的channel

    iwlist eth1 channel 11

    --------------

    设置模式:

    iwconfig eth1 mode managed

    通过MAC 设置AP:

    iwconfig eth1 ap 00:0A:EB:CA:79:B0

    连接到WEP on 的AP:

    iwconfig eth1 key s:12345 等效于 iwconfig eth1 enc 3132333435(12345的hex值) (为什么AP64bit的口令是40bit呢)

    iwconfig eth1 key on

    iwconfig eth1 essid sychip_demo

    断开WEP:

    iwconfig eth1 enc off

    查看IP:

    ifconfig eth1

    设置IP:

    ifconfig eth1 10.3.1.74

    把IP: 129.158.215.204 , netmask: 255.255.255.0分配给rh0,

    # ifconfig rh0 129.158.215.204 netmask 255.255.255.0

    获取IP;

    ifconfig eth1 dhcp start (从eth1走,不需要ip即可dhcp)

    udhcpc -i eth1

    udhcpc --help

    路由处理:

    若要删除以 10. 起始的 IP 路由表中的所有路由,请键入:

    route delete 10.*

    route del default

    route add -net 10.3.0.0 netmask 255.255.0.0 eth1 (eth1获得IP之前,使用此命令显示:No such device)

    iwconfig(8) - Linux man page

    Name iwconfig - configure a wireless network interface

    Synopsis

    iwconfig [

    interface

    ]

    iwconfig

    interface

    [essid

    X

    ] [nwid

    N

    ] [mode

    M

    ] [freq

    F

    ]

    [channel

    C

    ]

    [sens

    S

    ]

    [ap

    A

    ]

    [nick

    NN ]

    [rate

    R

    ] [rts

    RT

    ] [frag

    FT

    ] [txpower

    T

    ]

    [enc

    E

    ] [key

    K

    ] [power

    P

    ] [retry

    R

    ]

    [commit]

    iwconfig --help

    iwconfig --version

    Description

    Iwconfig is similar to

    Iwconfig may also be used to display those parameters, and the wireless statistics (extracted from

    /proc/net/wireless).

    All these parameters and statistics are device dependent. Each driver will provide only some of them depending on hardware support, and the range of values may change. Please refer to the man page of each device for details.

    Parameters

    essid

    Set the ESSID (or Network Name - in some products it may also be called Domain ID). The ESSID is used to identify cells which are part of the same virtual network.

    As opposed to the AP Address or NWID which define a single cell, the ESSID defines a group of cells connected via repeaters or infrastructure, where the user may roam transparently.

    With some cards, you may disable the ESSID checking (ESSID promiscuous) with

    off or

    any (and

    on to reenable it).

    If the ESSID of your network is one of the special keywords (

    off,

    on or

    any), you should use

    -- to escape it.

    Examples :

    iwconfig eth0 essid any

    iwconfig eth0 essid "My Network""

    iwconfig eth0 essid -- "ANY""

    nwid/

    domain

    Set the Network ID (in some products it may also be called Domain ID). As all adjacent wireless networks share the same medium, this parameter is used to differenciate them (create logical colocated networks) and identify nodes belonging to the same cell.

    This parameter is only used for pre-802.11 hardware, the 802.11 protocol uses the ESSID and AP Address for this function.

    With some cards, you may disable the Network ID checking (NWID promiscuous) with

    off (and

    on to reenable it).

    Examples :

    iwconfig eth0 nwid AB34

    iwconfig eth0 nwid off

    nick[name]

    Set the nickname, or the station name. Some 802.11 products do define it, but this is not used as far as the protocols (MAC, IP, TCP) are concerned and completely useless as far as configuration goes. Only some wireless diagnostic tools may use it.

    Example :

    iwconfig eth0 nickname "My Linux Node""

    mode

    Set the operating mode of the device, which depends on the network topology. The mode can be

    Ad-Hoc (network composed of only one cell and without Access Point),

    Managed (node connects to a network composed of many Access Points, with roaming),

    Master (the node is the synchronisation master or acts as an Access Point),

    Repeater (the node forwards packets between other wireless nodes),

    Secondary (the node acts as a backup master/repeater),

    Monitor (the node is not associated with any cell and passively monitor all packets on the frequency) or

    Auto.

    Example :

    iwconfig eth0 mode Managed

    iwconfig eth0 mode Ad-Hoc

    freq/

    channel

    Set the operating frequency or channel in the device. A value below 1000 indicates a channel number, a value greater than 1000 is a frequency in Hz. You may append the suffix k, M or G to the value (for example, "2.46G" for 2.46 GHz frequency), or add enough '0'.

    Channels are usually numbered starting at 1, and you may use

    off or

    auto to let the card pick up the best channel (when supported).

    Examples :

    iwconfig eth0 freq 2422000000

    iwconfig eth0 freq 2.422G

    iwconfig eth0 channel 3

    iwconfig eth0 channel auto

    ap

    Force the card to register to the Access Point given by the address, if it is possible. This address is the cell identity of the Access Point, as reported by wireless scanning, which may be different from its network MAC address. If the wireless link is point to point, set the address of the other end of the link. If the link is ad-hoc, set the cell identity of the ad-hoc network.

    When the quality of the connection goes too low, the driver may revert back to automatic mode (the card selects the best Access Point in range).

    You may also use

    off to re-enable automatic mode without changing the current Access Point, or you may use

    any or

    auto to force the card to reassociate with the currently best Access Point.

    Example :

    iwconfig eth0 ap 00:60:1D:01:23:45

    iwconfig eth0 ap any

    iwconfig eth0 ap off

    rate/

    bit[rate]

    For cards supporting multiple bit rates, set the bit-rate in b/s. The bit-rate is the speed at which bits are transmitted over the medium, the user speed of the link is lower due to medium sharing and various overhead.

    You may append the suffix k, M or G to the value (decimal multiplier : 10^3, 10^6 and 10^9 b/s), or add enough '0'. Values below 1000 are card specific, usually an index in the bit-rate list. Use

    auto to select automatic bit-rate mode (fallback to lower rate on noisy channels), which is the default for most cards, and

    fixed to revert back to fixed setting. If you specify a bit-rate value and append

    auto, the driver will use all bit-rates lower and equal than this value.

    Examples :

    iwconfig eth0 rate 11M

    iwconfig eth0 rate auto

    iwconfig eth0 rate 5.5M auto

    txpower

    For cards supporting multiple transmit powers, sets the transmit power in dBm. If

    W is the power in Watt, the power in dBm is

    P = 30 +10.log(W). If the value is postfixed by

    mW, it will be automatically converted to dBm.

    In addition,

    on and

    off enable and disable the radio, and

    auto and

    fixed enable and disable power control (if those features are available).

    Examples :

    iwconfig eth0 txpower 15

    iwconfig eth0 txpower 30mW

    iwconfig eth0 txpower auto

    iwconfig eth0 txpower off

    sens

    Set the sensitivity threshold. This define how sensitive is the card to poor operating conditions (low signal, interference). Positive values are assumed to be the raw value used by the hardware or a percentage, negative values are assumed to be dBm. Depending on the hardware implementation, this parameter may control various functions.

    On modern cards, this parameter usually control handover/roaming threshold, the lowest signal level for which the hardware remains associated with the current Access Point. When the signal level goes below this threshold the card starts looking for a new/better Access Point. Some cards may use the number of missed beacons to trigger this. For high density of Access Points, a higher threshold make sure the card is always associated with the best AP, for low density of APs, a lower threshold minimise the number of failed handoffs.

    On more ancient card this parameter usually controls the defer threshold, the lowest signal level for which the hardware considers the channel busy. Signal levels above this threshold make the hardware inhibits its own transmission whereas signals weaker than this are ignored and the hardware is free to transmit. This is usually strongly linked to the receive threshold, the lowest signal level for which the hardware attempts packet reception. Proper setting of these thresholds prevent the card to waste time on background noise while still receiving weak transmissions. Modern designs seems to control those thresholds automatically.

    Example :

    iwconfig eth0 sens -80

    iwconfig eth0 sens 2

    retry

    Most cards have MAC retransmissions, and some allow to set the behaviour of the retry mechanism.

    To set the maximum number of retries, enter

    limit 'value'. This is an absolute value (without unit). To set the maximum length of time the MAC should retry, enter

    lifetime 'value'. By defaults, this value in in seconds, append the suffix m or u to specify values in milliseconds or microseconds.

    You can also add the

    min and

    max modifiers. If the card supports automatic mode, they define the bounds of the limit or lifetime. Some other cards define different values depending on packet size, for example in 802.11

    min limit is the short retry limit (non RTS/CTS packets).

    Examples :

    iwconfig eth0 retry 16

    iwconfig eth0 retry lifetime 300m

    iwconfig eth0 retry min limit 8

    rts[_threshold]

    RTS/CTS adds a handshake before each packet transmission to make sure that the channel is clear. This adds overhead, but increases performance in case of hidden nodes or a large number of active nodes. This parameter sets the size of the smallest packet for which the node sends RTS ; a value equal to the maximum packet size disables the mechanism. You may also set this parameter to

    auto,

    fixed or

    off.

    Examples :

    iwconfig eth0 rts 250

    iwconfig eth0 rts off

    frag[mentation_threshold]

    Fragmentation allows to split an IP packet in a burst of smaller fragments transmitted on the medium. In most cases this adds overhead, but in a very noisy environment this reduces the error penalty and allow packets to get through interference bursts. This parameter sets the maximum fragment size which is always lower than the maximum packet size.

    This parameter may also control Frame Bursting available on some cards, the ability to send multiple IP packets together. This mechanism would be enabled if the fragment size is larger than the maximum packet size.

    You may also set this parameter to

    auto,

    fixed or

    off.

    Examples :

    iwconfig eth0 frag 512

    iwconfig eth0 frag off

    key/

    enc[ryption]

    Used to manipulate encryption or scrambling keys and security mode.

    To set the current encryption key, just enter the key in hex digits as

    XXXX-XXXX-XXXX-XXXX or

    XXXXXXXX. To set a key other than the current key, prepend or append

    [index] to the key itself (this won't change which is the active key). You can also enter the key as an ASCII string by using the

    s: prefix. Passphrase is currently not supported.

    To change which key is the currently active key, just enter

    [index] (without entering any key value).

    off and

    on disable and reenable encryption.

    The security mode may be

    open or

    restricted, and its meaning depends on the card used. With most cards, in

    open mode no authentication is used and the card may also accept non-encrypted sessions, whereas in

    restricted mode only encrypted sessions are accepted and the card will use authentication if available.

    If you need to set multiple keys, or set a key and change the active key, you need to use multiple

    key directives. Arguments can be put in any order, the last one will take precedence.

    Examples :

    iwconfig eth0 key 0123-4567-89

    iwconfig eth0 key [3] 0123-4567-89

    iwconfig eth0 key s:password [2]

    iwconfig eth0 key [2]

    iwconfig eth0 key open

    iwconfig eth0 key off

    iwconfig eth0 key restricted [3] 0123456789

    iwconfig eth0 key 01-23 key 45-67 [4] key [4]

    power

    Used to manipulate power management scheme parameters and mode.

    To set the period between wake ups, enter

    period 'value'. To set the timeout before going back to sleep, enter

    timeout 'value'. You can also add the

    min and

    max modifiers. By default, those values are in seconds, append the suffix m or u to specify values in milliseconds or microseconds. Sometimes, those values are without units (number of beacon periods, dwell or similar).

    off and

    on disable and reenable power management. Finally, you may set the power management mode to

    all (receive all packets),

    unicast (receive unicast packets only, discard multicast and broadcast) and

    multicast (receive multicast and broadcast only, discard unicast packets).

    Examples :

    iwconfig eth0 power period 2

    iwconfig eth0 power 500m unicast

    iwconfig eth0 power timeout 300u all

    iwconfig eth0 power off

    iwconfig eth0 power min period 2 power max period 4

    commit

    Some cards may not apply changes done through Wireless Extensions immediately (they may wait to aggregate the changes or apply it only when the card is brought up via ifconfig). This command (when available) forces the card to apply all pending changes.

    This is normally not needed, because the card will eventually apply the changes, but can be useful for debugging.

    Display For each device which supports wireless extensions,

    iwconfig will display the name of the

    MAC protocol used (name of device for proprietary protocols), the

    ESSID (Network Name), the

    NWID, the

    frequency (or channel), the

    sensitivity, the

    mode of operation, the

    Access Point address, the

    bit-rate, the

    RTS threshold, the

    fragmentation threshold, the

    encryption key and the

    power management settings (depending on availability).

    The parameters displayed have the same meaning and values as the parameters you can set, please refer to the previous part for a detailed explanation of them.

    Some parameters are only displayed in short/abbreviated form (such as encryption). You may use =', it means that the parameter is fixed and forced to that value, if it is prefixed by ':', the parameter is in automatic mode and the current value is shown (and may change).

    Access Point/

    Cell

    An address equal to 00:00:00:00:00:00 means that the card failed to associate with an Access Point (most likely a configuration issue). The

    Access Point parameter will be shown as

    Cell in ad-hoc mode (for obvious reasons), but otherwise works the same.

    If /proc/net/wireless exists, iwconfig will also display its content. Note that those values will depend on the driver and the hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values.

    Link quality

    Overall quality of the link. May be based on the level of contention or interference, the bit or frame error rate, how good the received signal is, some timing synchronisation, or other hardware metric. This is an aggregate value, and depends totally on the driver and hardware.

    Signal level

    Received signal strength (RSSI - how strong the received signal is). May be arbitrary units or dBm,

    iwconfig uses driver meta information to interpret the raw value given by

    /proc/net/wireless and display the proper unit or maximum value (using 8 bit arithmetic). In

    Ad-Hoc mode, this may be undefined and you should use

    iwspy.

    Noise level

    Background noise level (when no packet is transmitted). Similar comments as for

    Signal level.

    Rx invalid nwid

    Number of packets received with a different NWID or ESSID. Used to detect configuration problems or adjacent network existence (on the same frequency).

    Rx invalid crypt

    Number of packets that the hardware was unable to decrypt. This can be used to detect invalid encryption settings.

    Rx invalid frag

    Number of packets for which the hardware was not able to properly re-assemble the link layer fragments (most likely one was missing).

    Tx excessive retries

    Number of packets that the hardware failed to deliver. Most MAC protocols will retry the packet a number of times before giving up.

    Invalid misc

    Other packets lost in relation with specific wireless operations.

    Missed beacon

    Number of periodic beacons from the Cell or the Access Point we have missed. Beacons are sent at regular intervals to maintain the cell coordination, failure to receive them usually indicates that the card is out of range.

    展开全文
  • iwenhou趁周末,复习一下鸟哥的linux私房菜,看了文件内容查阅部分,做个笔记,哈哈,希望对你有帮助哦。catcat : 由第一行开始显示文件所有内容参数说明cat [-AbEnTv] 参数: -A : 相当于-vET 的整合参数,可列出...
    iwenhou
    趁周末,复习一下鸟哥的linux私房菜,看了文件内容查阅部分,做个笔记,哈哈,希望对你有帮助哦。

    cat

    cat : 由第一行开始显示文件所有内容

    参数说明

    cat [-AbEnTv]

    参数:

    -A : 相当于-vET 的整合参数,可列出一些特殊字符,而不是空白而已	
    -b :列出行号,仅针对非空白行做行号显示,空白行不标行号	
    -E :将结尾的断行字符$显示出来	
    -n : 打印行号,连同空白行也会有行号,与-b的参数不同

    范例demo

    范例一:

    查看cattest.txt的内容
    [root@iZ2zehkwp9rwg4azsvnjbuZ whx]# cat cattest.txt	
    test cat command	
    jaywei	
    #####

    范例二:

    查看cattest.txt的内容,并且显示行号
    [root@iZ2zehkwp9rwg4azsvnjbuZ whx]# cat -n cattest.txt	
         1    test cat command	
         2    jaywei	
         3    	
         4    #####

    适用场景

    • cat是Concatenate的缩写,主要功能是将一个文件的内容连续显示在屏幕上面。
    • 一般文件内容行数较少时,如40行之内,适合用cat。
    • 如果是一般的DOS文件时,就需要特别留意一些奇怪的符号,例如断行与[Tab]等,要显示出来,就得加入-a之类的参数了。

    tac

    tac : 从最后一行开始显示,可以看出tac是cat的倒写形式

    范例demo

    [root@iZ2zehkwp9rwg4azsvnjbuZ whx]# tac  cattest.txt	
    
    #####	
    
    jaywei	
    
    test cat command

    适用场景

    • tac 的功能跟cat相反,cat是由“第一行到最后一行连续显示在屏幕上”,而tac则是“由最后一行到第一行反向在屏幕上显示出来”。

    head

    head :显示文件开头的内容,以行为单位,默认文件开头的前10行

    参数说明

    head [OPTION]... FILE...	
    
    -n<行数> 显示的行数	
    
    -q 隐藏文件名	
    
    -v 显示文件名	
    
    -c<字节> 显示字节数

    范例demo

    显示 sentinel.conf 文件前12行.
    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# head -n 12  sentinel.conf	
    # Example sentinel.conf	
    # *** IMPORTANT ***	
    #	
    # By default Sentinel will not be reachable from interfaces different than	
    # localhost, either use the 'bind' directive to bind to a list of network	
    # interfaces, or disable protected mode with "protected-mode no" by	
    # adding it to this configuration file.	
    #	
    # Before doing that MAKE SURE the instance is protected from the outside	
    # world via firewalling or other means.	
    #

    tail

    查看文件的内容,也是以行为单位,默认10行,从尾往前看。监听Java动态日志时,一般跟 -f参数配合使用。

    参数说明

    tail [参数] [文件]  	
    -f 循环读取	
    -q 不显示处理信息	
    -v 显示详细的处理信息	
    -c<数目> 显示的字节数	
    -n<行数> 显示文件的尾部 n 行内容

    范例一

    显示sentinel.conf文件的最后12行
    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# tail -n 12  sentinel.conf	
    # <role> is either "leader" or "observer"	
    #	
    # The arguments from-ip, from-port, to-ip, to-port are used to communicate	
    # the old address of the master and the new address of the elected slave	
    # (now a master).	
    #	
    # This script should be resistant to multiple invocations.	
    #	
    # Example:	
    #	
    # sentinel client-reconfig-script mymaster /var/redis/reconfig.sh

    范例二

    持续检测sentinel.conf的内容
    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# tail -f sentinel.conf	
    # The arguments from-ip, from-port, to-ip, to-port are used to communicate	
    # the old address of the master and the new address of the elected slave	
    # (now a master).	
    #	
    # This script should be resistant to multiple invocations.	
    #	
    # Example:	
    #	
    # sentinel client-reconfig-script mymaster /var/redis/reconfig.sh	
    <==要等到输入[ctrl]-c 之后才离开tail 这个命令的检测

    范例三

    持续检测sentinel.conf的内容,并匹配redis关键字。匹配关键字,一般用 grep , tail 一般也会跟 grep搭档使用。
    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# tail -f sentinel.conf | grep redis	
    # sentinel client-reconfig-script mymaster /var/redis/reconfig.sh	
    <==要等到输入[ctrl]-c 之后才离开tail 这个命令的检测

    适用场景

    • tial-f 被用来动态监听Java日志,开发联调经常使用到,它一般跟 grep 一起搭档使用。

    more

    more :一页一页地显示文件内容

    参数说明

    more [-dlfpcsu] [-num] [+/pattern] [+linenum] [fileNames..]

    参数:

    -num :一次显示的行数

    -p :不以卷动的方式显示每一页,而是先清除萤幕后再显示内容

    -c : 跟 -p 相似,不同的是先显示内容再清除其他旧资料

    -s : 当遇到有连续两行以上的空白行,就代换为一行的空白行

    +/pattern : 在每个文档显示前搜寻该字串(pattern),然后从该字串之后开始显示

    -u :不显示下引号 (根据环境变数 TERM 指定的 terminal 而有所不同)

    +num : 从第 num 行开始显示

    fileNames :欲显示内容的文档,可为复数个数

    常用操作命令

    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# more sentinel.conf	
    # Example sentinel.conf	
    ...(中间省略) ...	
    # Note that whatever is the ODOWN quorum, a Sentinel will require to	
    # be elected by the majority of the known Sentinels in order to	
    # start a failover, so no failover can be performed in minority.	
    #	
    # Slaves are auto-discovered, so you don't need to specify slaves in	
    --More--(29%)
    仔细看上面的范例,如果more后面接的文件内容行数大于屏幕输出的行数时,就会出现类似上面的图示。重点在最后一行,最后一行会显示出目前显示的百分比,而且还可以在最后一行输入一些有用的命令。在more这个程序的运行过程中,你可以使用一些常用的操作命令:
    • 空格键 :代表往下翻一页
    • Enter : 代表往下滚动一行
    • /字符串 :代表在这个显示的内容当中,向下查询“字符串” 这个关键字
    • :f :立刻显示出文件名以及目前显示的行数
    • q :代表立刻离开more,不再显示该文件内容
    • b或[Ctrl]-b :代表往回翻页,不过这操作只对文件有用,对管道无用。

    最常用的是:按 q离开,按 空格键往下翻页,按 b往回翻页,以及 /字符串搜索功能,请看以下demo

    范例demo

    范例一

    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# more -10 sentinel.conf	
    # Example sentinel.conf	
    ...(此处省略)...	
    # Before doing that MAKE SURE the instance is protected from the outside	
    --More--(4%)

    分页查看sentinel.conf文件,一页展示10行。按下 空格键,可以往下翻页,

    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# more -10 sentinel.conf	
    # Example sentinel.conf	
    ...(此处省略)...	
    # protected-mode no	
    # port <sentinel-port>	
    # The port that this sentinel instance will run on	
    --More--(7%)

    按下 b,可以回退到上一页

    # *** IMPORTANT ***	
    ...(此处省略)...	
    # Before doing that MAKE SURE the instance is protected from the outside	
    # world via firewalling or other means.	
    --More--(5%)

    按下 q,可以立刻离开more

    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# 

    范例二

    如果想在sentinel.conf文件中,搜寻sentinel关键字,可以这样做
    [root@iZ2zehkwp9rwg4azsvnjbuZ redis-4.0.7]# more -10  sentinel.conf	
    # Example sentinel.conf	
    ...(此处省略)...	
    # Before doing that MAKE SURE the instance is protected from the outside	
    /sentinel  输入/之后,光标就会自动跑到最下面一行等待输入

    如同上面的说明,输入了/之后,光标就会跑到最下面一行,并且等待你的输入,你输入了字符串并按下[Enter]之后,more就会开始向下查询该字符串,而重复查询同一个字符串,可以直接按下n即可。最后不想看了,就按下q离开more。

    # Before doing that MAKE SURE the instance is protected from the outside	
    /sentinel	
    ...skipping	
    # protected-mode no	
    # port <sentinel-port>	
    # The port that this sentinel instance will run on	
    port 26379	
    # sentinel announce-ip <ip>	
    # sentinel announce-port <port>	
    #	
    /	
    ...skipping	
    # Example:	
    #	
    # sentinel announce-ip 1.2.3.4	
    # dir <working-directory>	
    # Every long running process should have a well-defined working directory.	
    # For Redis Sentinel to chdir to /tmp at startup is the simplest thing	
    # for the process to don't interfere with administrative tasks such as	
    # unmounting filesystems.	
    --More--(23%)

    适用场景

    • more适合日志比较大的文件查看,可以一页一页查看,不会让前面的数据看不到。

    less

    less 与 more 类似,但less的用法比起more又更加有弹性。

    • 若使用了less时,就可以使用下、下等按键的功能来往前往后翻看文件。
    • 除此之外,在less里头可以拥有更多的查询功能。不止可以向下查询,也可以向上查询。

    常用操作命令

    • 空格键:往下翻动一页
    • [pagedown]:向下翻动一页
    • [pageup]:向上翻动一页
    • Enter : 代表往下滚动一行
    • y :向前滚动一行
    • /字符串:向下搜索"字符串"的功能
    • ?字符串:向上搜索"字符串"的功能
    • n:重复前一个搜索(与 / 或 ? 有关)
    • N:反向重复前一个搜索(与 / 或 ? 有关)
    • q: 离开less这个程序
    • b 向后翻一页

    范例demo

    范例一

    在sentinel.conf文件中,搜寻sentinel关键字,如下

    less sentinel.conf

    输入反斜杠 /,输入关键字 sentinel,回车

    72224b40e035330c54440b8bf5a2dfdf.png

    重复前一个搜索,可以按n,反向重复前一个搜索,按N

    范例二

    Linux 动态查看日志文件,一般用tail -f ,但是我们也可以用less+ F 实现。
    less + file-name + 命令 F =  tail -f + file-name

    我们经常用tail -f +grep 关键字,动态查找报错的日志,也可以用less实现。先输入shirft+g,到达文件结尾

    d0e363091d3d93ea485950eb706926c2.png

    然后输入 ,输入搜索关键字,如 sentinel,回车,然后按 n键往上搜索,效果是不是也不错?尤其日志文件动态刷新太快的时候,奸笑脸。

    578ab7ad9a2f521efd85119d12b45226.png

    适用场景

    less适合日志比较大的文件查看,可以一页一页查看,并且比more更灵活,也可以动态查看日志,我一般用它查看Java日志。

    小结

    本文总结了查看日志的几个linux命令,cat、tac、head、tail、more、less,其中less真的很适合日常开发日志查看,非常推荐less。

    原文链接:https://blog.csdn.net/weiwenhou/article/details/102774286

    展开全文
  • wpa是一个linux自带的WiFi管理工具,一般python或者其他wifi库在底层都是调用wpa的相关的命令,所以了解wpa命令很重要,wpa服务启动(基于conf): wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supp...
  • whereis简介本文主要讲解whereis的功能与日常使用方法,该命令可以用于查找Linux指定命令的二进制文件、源文件和帮助文件的位置。 显示结果会去除主路径名和后缀名。whereis默认会在环境变量配置里查找程序位置。2....
  • Linux系统有多个查看文件内容的命令,现在来看各个命令的应用场景和使用方法。1、cat用于显示小文件的内容,或者在shell脚本里显示文件内容,不支持翻页。[root@localhost ~]# cat /etc/fstab ## /etc/fstab# ...
  • 我已经在wifi-linux上实验了大约两个小时,并且它工作的很好,但是我希望在不久的将来在作者那里看到一些单元测试,因为命令plot无法在我的电脑上工作,并且会导致一些问题。什么是wifi-linux根据github上...
  • ngGet password of the wifi you're connected, and your current ip address, supports linux, macos, windows.☤ QuickstartGet your ip address:$ ng ip`local_ip:192.168.1.114public_ip:49.4.160.250`Get wifi ...
  • 项目需求:用户在web端输入wifi名称和密码,客户端可以通过服务端下发的信息进行连接技术调研:之前提到过nmcli指令,这次他又来了连接:nmcli device wifi connect wifiname password wifipasswd 删除:nmcli con del...
  • kali linux破解wifi密码-超详细过程

    万次阅读 多人点赞 2019-09-02 14:49:50
    无线网卡(芯片为3070或者1887L都支持Linux) 一.打开终端,用airmon-ng命令查看 如果出现无法访问…没有那个文件或目录 解决办法:先在window主机上按win+r键然后输入services.msc 回车 找到VMware USB ...
  • Note: To connect your Linux machine to a WLAN using WPA, WPA2 or 802.1X you will need to use WPA Supplicant Note: replace [interface] with your interface name as required (e.g. eth1, wlan0, ath0 etc....
  • iwconfigiwconfig是Linux WirelessExtensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,而且主流的Linux...
  • 无论何时要安装一款新的 Linux 发行系统,一般的建议都是让您通过有线连接来接到互联网的。这主要的原因有两条:第一,您的无线网卡也许安装的驱动不正确而不能用;第二,如果您是从命令行中来安装系统的,管理 WiFi...
  • Linux中使用df命令查看文件系统通过df命令可以査看已经挂载的文件系统的信息。包括设备文件名、文件系统总大小、已经使用的大小、剩余大小、使用率和挂载点等等。1、命令格式df [选项] [挂载点/分区设备文件名]2、...
  • Linux查看WIFI信号强弱: $iwconfig wlan0 | grep -i --color quality //查询网络连接质量着红色Link Quality=47/70 Signal level=-63 dBm $ iwconfig wlan0 | grep -i --color signal //查询信号强度着红色 Link...
  • android linux wifi 等网络设备调试命令. 这些命令非常方便在无显示屏或者按键的情况下,进行wifi模块的调测使用。
  • linux下如何使用命令连接wifi

    万次阅读 2018-11-21 19:21:46
    (1)首先ifconfig命令查看一下 1|root@sabresd_6dq:/ # ifconfig eth0 Link encap:Ethernet HWaddr 12:21:12:12:12:34 inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROAD...
  • 有些情况下我们需要将连接并认证过的wifi共享出来,这样就无需多个认证达到多人使用了无线网卡是否支持AP模式无线设备必须兼容 nl80211标准 ,并且支持 AP (Access Point)工作模式。可通过 iw list 命令查看无线网卡...
  • F74A"root@kali:~# iwconfig wlan0 key "123456"root@kali:~# iwconfig wlan0 ap autoroot@kali:~# iwconfig wlan0 192.168.01.104root@kali:~# exit 第二种: 查找可用WiFi适配器:root@kali:~# iw dev 检查无线网卡...
  • 原标题:Linux下如何通过命令连接wifi项目需求:用户在web端输入wifi名称和密码,客户端可以通过服务端下发的信息进行连接技术调研:之前提到过nmcli指令,这次他又来了连接:nmcli device wifi connect wifiname ...
  • linux WIFI命令iwlist、iwconfig、iwpriv

    千次阅读 2019-04-29 16:56:08
     示例: #iwconfig eth0 nickname "My Linux Node"      mode: 配置无线网卡的工作模式,能够是  Ad-hoc:不带AP的点对点无线网络  Managed:通过多个AP组成的网络,无线设备能够在这个网络中漫游  ...
  • 我想扫描从3 AP收到的信号强度.如果每300毫秒(最长500毫秒)发生这种情况,我会很高兴.我在路由器上刷了OpenWRT.我正在寻找一个很好的工具来做到这一点.首先,我发现iwconfig有效,但只有我...但是获得来自WIFI的信号强...
  • Linux创建WiFi热点

    2020-10-13 10:09:02
    sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq 此时可以创建热点,通过以下命令: sudo create_ap wlan0 eth0 热点名 密码 接下来,设置开机自启就可以了。 ...
  • kali linux 破解wifi

    2019-03-21 15:49:27
    Windows虚拟机安装kali linux 破解WiFi 请合理使用此功能,破解WiFi属于违法行为! 网卡需要支持监听模式 1.启动无线网卡 airmon-ng start wlan0 2.搜索WiFi信号 airodump-ng wlan0mon 搜索到信号后按CTRL+C键...
  • 故事背景:我司是做新零售的,机器支持4G、wifi、网线,可能会涉及到网络的切换和连接 项目需求:用户在web端输入wifi名称和密码,客户端可以通过服务端下发的信息进行连接 技术调研:之前提到过nmcli指令,...
  • 点击蓝字关注我哦以下是本期干货视频视频后还附有文字版本哦▼《名企高频考点-Linux命令之find》▼ps:请在WiFi环境下打开,如果有钱任性请随意0.概述在我们面试各大公司的时候,关于Linux往往最容易问到的问题之一...
  • 说明:本环境LINUX系统为Fedora,无线网卡为水星MW300U需要保证无线网卡能正常读取,iwconfig一、关闭图形界面1、查看状态:serviceNetworkManager status2、关闭命令:systemctldisable /usr/lib/systemd/system/...
  • Linux安装WIFI无线网卡驱动 0.安装解压命令 sudo apt install unzip 1.查看电脑的无线网卡型号,我的为RTL8822CE. 2.在github上按型号搜索相应驱动 ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 614
精华内容 245
关键字:

linux命令wifi

linux 订阅