Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:58:40+00:00 2026-06-11T01:58:40+00:00

Is there any way to get current wireless SSID without root permission? iwconfig tells

  • 0

Is there any way to get current wireless SSID without root permission?

iwconfig tells me ESSID, but only if I run it as root.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:58:42+00:00Added an answer on June 11, 2026 at 1:58 am

    If you take a look at the source code of the iwconfig (wireless_tools), you’ll see this line:

    iwconfig.c:639: if(iw_get_ext(skfd, ifname, SIOCGIWESSID, &wrq) < 0)
    

    This line is responsible for the get of ESSID (wireless.h). And i think that only root have permissions (out of the box) to do this, so the function iw_get_ext (defined in iwlib.h from wireless_tools package) which call ioctl will return EPERM (Operation not permitted).

    /*------------------------------------------------------------------*/
    /*
     * Wrapper to extract some Wireless Parameter out of the driver
     */
    static inline int
    iw_get_ext(int                  skfd,           /* Socket to the kernel */
               const char *         ifname,         /* Device name */
               int                  request,        /* WE ID */
               struct iwreq *       pwrq)           /* Fixed part of the request */
    {
      /* Set device name */
      strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
      /* Do the request */
      return(ioctl(skfd, request, pwrq));
    }
    

    You have 2 solutions:

    1. Use the setuid to allow the user to use iwconfig command:

      sudo chmod u+s /sbin/iwconfig

    2. You can also try to do some hacking with the CAP_NET_ADMIN capability which allow some specific capabilities to a specific user. Here some links about CAP_NET_ADMIN:

    http://packetlife.net/blog/2010/mar/19/sniffing-wireshark-non-root-user/

    http://peternixon.net/news/2012/01/28/configure-tcpdump-work-non-root-user-opensuse-using-file-system-capabilities/

    http://www.lids.org/lids-howto/node48.html

    http://lwn.net/Articles/430462/

    Finally you can use strace to trace all system calls and to confirm that ioctl call is the responsible for this:

    as root do this:

    #strace /sbin/iwconfig your_interface_name > strace_iwconfig_root.log
    

    And the same as normal user:

    $strace /sbin/iwconfig your_interface_name > strace_iwconfig_normal.log
    

    And compare the results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way for me to get at a UITextField's current caret position
Is there any way to get current function name in C++? I want to
Is there any way to get a pointer to the current function, maybe through
Is there any way to parse the HTTP_USER_AGENT to get the current user language
Given an instance of a System.Web.UI.Page, is there any way to get the current
Is there any way to programmatically get the current user's email address? I know
Is there any way to get the status of the Battery (charging/discharging/Current Charge/Capacity/etc...) from
Is there any way to get current revision number of TortoiseSVN 1.7 local working
I know how to get the current controller name HttpContext.Current.Request.RequestContext.RouteData.Values[controller].ToString(); But is there any
Is there any way to get HttpContext.Current.Request.Url.Host and HttpContext.Current.Request.ApplicationPath in one call? Something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.