Ubuntu – While launching samba I get an Error

gksusambasystem

I'm using Xubuntu 18.04 and while launching Samba I get an error saying "Failed to execute command gksu system-config-samba" please help. I'm a beginner.

Best Answer

  • Open a terminal and run this command:

    sudo touch /etc/libuser.conf
    

    Then run this command to start the application:

    sudo -H system-config-samba
    

    Edit: To have it launch from the menu:

    ** Create a new file at: /usr/share/polkit-1/actions/com.ubuntu.pkexec.samba.policy

    Add this to it:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE policyconfig PUBLIC
     "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
     "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
    <policyconfig>
    
      <action id="com.ubuntu.pkexec.samba">
        <message>Authentication is required to run the Samba Server Settings</message>
            <icon_name>samba</icon_name>
        <defaults>
          <allow_any>auth_admin</allow_any>
          <allow_inactive>auth_admin</allow_inactive>
          <allow_active>auth_admin</allow_active>
        </defaults>
        <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/system-config-samba</annotate>
        <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
      </action>
    

    ** Edit the launcher at /usr/share/applications/system-config-samba.desktop

    Find this line: Exec=gksu system-config-samba

    Replace with this line: Exec=pkexec system-config-samba

    Note: This seems overkill for something that:

    (1) WIll likely be used once or twice in a year.

    (2) Will eventually be removed from the repository: https://bugs.launchpad.net/ubuntu/+source/system-config-samba/+bug/1740419

  • Related Question