Hi Dan,<br><br>I'm not using NM to configure 802.1x. I'm configuring 802.1x with wpa_supplicant directly. And I'm trying to do a computer name authentication. I wonder if wpa_supplicant supports such authentication, and how to do it.<br><br>The username widget in NM could input hostname of course, but the password widget must be input also, or the SAVE button is greyed out. However, if I input both username and password, the RADIUS protocol will think I'm doing a user authentication, as is not what I want.<br><br>I wonder if I've made my idea clear.<br><br>在2013/03/28, "Dan Williams" &lt;dcbw@redhat.com&gt; 写道:<br>On Thu, 2013-03-28 at 20:27 +0800, McArthor Lee wrote:
&gt; Hi all,
&gt; 
&gt; 
&gt; 
&gt; In my corporation, NPS policy does not use AD username/password authentication, for it's too much less secure.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; For some laptops and PCs, Ubuntu 12.04 x86 desktop edition is deployed. I found that Ubuntu Network Manager only supports username/password for 802.1x authentication. After some googling, I found wpa_supplicant works at the background of Network Manager.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; I checked some guides which stated how to authenticate with domain computer name using wpa_supplicant, but it does not work. The guides are somewhat old, for Ubuntu 8.x version.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; Below is the detailed test process and error result. Please help to check what's wrong and what to do.
&gt; 
&gt; 
&gt; 
&gt; 
&gt; Setup a test lab with DC/DHCP/NPS servers on Hyper-V, as well as a Cisco 2960G switch. Connect the Hyper-V host to port 17 of the switch. After some configurations, a Windows 7 client can authenticate with domain computer name, through port 16 of the Cisco switch. So the lab environment is OK now. Note: I created a domain user "testadmin" belonging to "Domain Admins" group, and login with this user for all DHCP/NPS/IE-browser logins.
&gt; 
&gt; Fresh install an Ubuntu 12.04 x86 desktop edition to a test client. After installation, do no system updates, nor modifications to system settings.
&gt; 
&gt; Install likewise, and join the test client to the test domain. Of course, this process is done when the test client is connected to a default-authorized port of the Cisco switch, say port 14.
&gt; 
&gt; Generate proper certificates:
&gt; 
&gt; sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout privcert.pem -out privcert.pem
&gt; 
&gt; sudo openssl req -new -newkey rsa:1024 -nodes -keyout privkey.pem -out certreq.pem
&gt; 
&gt; Copy certreq.pem to DC. Open IE and type http://127.0.0.1/certsrv. Then click in turn: "Request a Certificate", "Advanced Certificate Request", "Submit a certificate request by using a base-64-encoded CMC or ......" (a very long option). Copy certreq.pem content to the "Base-64-encoded certificate request" text box, and select "Administrator" template, and then click "Submit", and then download the "Base 64 encoded" certificate. The certificate filename is certnew.cer. Copy the file certnew.cer back to the Ubuntu test client.
&gt; 
&gt; Copy certnew.cer to /etc/ssl/certs/ubuntu.domain.pem.
&gt; 
&gt; Copy privkey.pem to /etc/ssl/private/.
&gt; 
&gt; Edit /etc/wpa_supplicant/wpa_supplicant.conf, and below it's its content:
&gt; 
&gt;     ctrl_interface=/var/run/wpa_supplicant
&gt;     ctrl_interface_group=0
&gt;     eapol_version=1
&gt;     ap_scan=0
&gt;     network={
&gt;         ssid="domaintest"
&gt;         key_mgmt=IEEE8021X
&gt;         eap=PEAP
&gt;         phase2="auth=MSCHAPV2" # whether or not using this option leads the same error.
&gt;         identity="nps.test/computers/ubuntu" # "nps.test" is FQAN of the test domain. "ubuntu" is the hostname of the test client.
&gt;         client_cert="/etc/ssl/certs/ubuntu.domain.pem"
&gt;         private_key="/etc/ssl/private/privkey.pem"
&gt;     }

With NetworkManager, the 'identity' field is populated directly from the
Username widget.  The only thing that's missing here for NM is the
client-cert/private-key property usage with PEAP, which if this is
valid, could be added to NM fairly easily.

Dan

&gt; 
&gt; Connect the test client to port 16 (refer to section 1.) of the switch.
&gt; 
&gt; Type the following command, and get the follow error:
&gt; 
&gt; ubuntu@ubuntu:~$ sudo wpa_supplicant -ieth0 -Dwired -c/etc/wpa_supplicant/wpa_supplicant.conf
&gt; 
&gt; Associated with 01:80:c2:00:00:03
&gt; CTRL-EVENT-EAP-STARTED EAP authentication started
&gt; CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
&gt; OpenSSL: pending error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
&gt; OpenSSL: pending error: error:140C800D:SSL routines:SSL_use_certificate_file:ASN1 lib
&gt; OpenSSL: pending error: error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error
&gt; OpenSSL: pending error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
&gt; OpenSSL: pending error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
&gt; OpenSSL: pending error: error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib
&gt; OpenSSL: pending error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
&gt; OpenSSL: pending error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
&gt; OpenSSL: pending error: error:140CB00D:SSL routines:SSL_use_PrivateKey_file:ASN1 lib
&gt; CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
&gt; CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/CN=NPS-DC.nps.itc'
&gt; CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/CN=NPS-DC.nps.itc'
&gt; CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/CN=NPS-DC.nps.itc'
&gt; SSL: SSL3 alert: read (remote end reported an error):fatal:access denied
&gt; OpenSSL: openssl_handshake - SSL_connect error:14094419:SSL routines:SSL3_READ_BYTES:tlsv1 alert access denied
&gt; CTRL-EVENT-EAP-FAILURE EAP authentication failed
&gt; 
&gt; 
&gt; At NPS server, a error event log is respective to the above command:
&gt; 
&gt; Network Policy Server denied access to a user.
&gt; Contact the Network Policy Server administrator for more information.
&gt; User:
&gt;     Security ID:                    NULL SID
&gt;     Account Name:                   nps.test/computers/ubuntu
&gt;     Account Domain:                 NPS
&gt;     Fully Qualified Account Name:   NPS\UBUNTU$
&gt; Client Machine:
&gt;     Security ID:                    NULL SID
&gt;     Account Name:                   -
&gt;     Fully Qualified Account Name:   -
&gt;     OS-Version:                     -
&gt;     Called Station Identifier:      00-1D-A1-94-55-90
&gt;     Calling Station Identifier:     00-E0-4C-68-04-1D
&gt; NAS:
&gt;     NAS IPv4 Address:               192.168.1.66
&gt;     NAS IPv6 Address:               -
&gt;     NAS Identifier:                 -
&gt;     NAS Port-Type:                  Ethernet
&gt;     NAS Port:                       50016
&gt; RADIUS Client:
&gt;     Client Friendly Name:           switch
&gt;     Client IP Address:              192.168.1.66
&gt; Authentication Details:
&gt;     Connection Request Policy Name: NAP 802.1X (Wired)
&gt;     Network Policy Name:            -
&gt;     Authentication Provider:        Windows
&gt;     Authentication Server:          NPS-DC.nps.test
&gt;     Authentication Type:            PEAP
&gt;     EAP Type:                       -
&gt;     Account Session Identifier:     -
&gt;     Logging Results:                Accounting information was written to the local log file.
&gt;     Reason Code:                    16
&gt;     Reason:                         Authentication failed due to a user credentials mismatch. Either the user name provided does not map to an existing user account or the password was incorrect.
&gt; _______________________________________________
&gt; HostAP mailing list
&gt; HostAP@lists.shmoo.com
&gt; http://lists.shmoo.com/mailman/listinfo/hostap


<br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>