wiki:NetworkManager

NetworkManager


Allowing unprivileged users to modify network settings

Note: This configuration is not recommended for production. It is for example only!

One method is to modify the default policy for NetworkManager:

First, create a group for the purpose of managing network connections:

sudo /usr/sbin/groupadd -g 90 netadmins
sudo /usr/sbin/usermod -a -G netadmins <youruser>

This example is only that, an example. In fact, it is a copy of the permissions for the user root. You should probably break it apart into necessary groups for your system and give each group permissions that are needed:

cat >> /tmp/NetworkManager-BLFS.conf << "EOF"
<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

        <policy group="netadmins">
                <allow own="org.freedesktop.NetworkManager"/>
                <allow send_destination="org.freedesktop.NetworkManager"/>
                <allow own="org.freedesktop.nm_avahi_autoipd"/>
                <allow own="org.freedesktop.nm_dhcp_client"/>
                <allow own="org.freedesktop.nm_dispatcher"/>
                <allow send_destination="org.freedesktop.nm_dispatcher"/>
                <!-- PPP -->
                <allow send_destination="org.freedesktop.NetworkManager"
                       send_interface="org.freedesktop.NetworkManager.PPP"/>
                <allow send_interface="org.freedesktop.NetworkManager.SecretAgent"/>
                <allow send_destination="org.freedesktop.NetworkManager.pptp"/>
                <!-- VPN -->
                <!-- <allow send_interface="org.freedesktop.NetworkManager.SecretAgent"/> -->
                <!-- Allow NM to talk to known VPN plugins -->
                <allow send_destination="org.freedesktop.NetworkManager.openconnect"/>
                <allow send_destination="org.freedesktop.NetworkManager.openswan"/>
                <allow send_destination="org.freedesktop.NetworkManager.openvpn"/>
                <!-- <allow send_destination="org.freedesktop.NetworkManager.pptp"/> -->
                <allow send_destination="org.freedesktop.NetworkManager.vpnc"/>
        </policy>

</busconfig>

EOF

sudo install -vm644 /tmp/NetworkManager-BLFS.conf \
    /etc/dbus-1/system.d/NetworkManager-BLFS.conf

rm /tmp/NetworkManager-BLFS.conf

Up
Top

Last modified 9 years ago Last modified on 07/08/2012 09:06:04 PM
Note: See TracWiki for help on using the wiki.